-- Auto-generated SQL script #202306010624
UPDATE public.core_assets
	SET asset_parameters='{
  "form": [
    [
      {
        "id": "select ",
        "cols": 3,
        "name": "file",
        "type": "file",
        "label": "form_stash_files_select",
        "onchange": "jivaCoreFunc.loadFile(this); getFileName();",
        "mandatory": true
      },
      {
        "id": "title",
        "cols": 3,
        "name": "title",
        "type": "text",
        "label": "form_stash_files_title",
        "mandatory": false
      },
      {
        "id": "folder",
        "cols": 3,
        "list": ",documents,images,videos,settings,secret",
        "name": "folder",
        "type": "dropdown",
        "label": "form_stash_files_select_folder",
        "mandatory": false
      },
      {
        "id": "filename",
        "cols": 3,
        "name": "filename",
        "type": "text",
        "label": "form_stash_files_filename",
        "mandatory": false
      },
      {
        "id": "id",
        "cols": 3,
        "name": "objectId",
        "type": "hidden",
        "label": "",
        "mandatory": false
      }
    ]
  ]
}'::jsonb
	WHERE asset_type='form' and asset_name='stash_files_form';

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
   	 ('XSTDTDD','stash_entity_add','SFILEDT','addStashEntity','','stash/files','stash','Permission to add files/entities (V2)','EXE','',1,false,false,NULL);

-- TODO: create filesystem role ecc.