"Fossies" - the Fresh Open Source Software Archive

Member "administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql" (13 Sep 2021, 7048 Bytes) of package /linux/www/Joomla_4.0.3-Stable-Full_Package.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --
    2 -- Table structure for table "#__workflows"
    3 --
    4 
    5 CREATE TABLE IF NOT EXISTS "#__workflows" (
    6   "id" serial NOT NULL,
    7   "asset_id" bigint DEFAULT 0 NOT NULL,
    8   "published" smallint DEFAULT 0 NOT NULL,
    9   "title" varchar(255) DEFAULT '' NOT NULL,
   10   "description" text NOT NULL,
   11   "extension" varchar(50) NOT NULL,
   12   "default" smallint NOT NULL  DEFAULT 0,
   13   "ordering" bigint NOT NULL DEFAULT 0,
   14   "created" timestamp without time zone NOT NULL,
   15   "created_by" bigint DEFAULT 0 NOT NULL,
   16   "modified" timestamp without time zone NOT NULL,
   17   "modified_by" bigint DEFAULT 0 NOT NULL,
   18   "checked_out_time" timestamp without time zone,
   19   "checked_out" bigint DEFAULT 0 NOT NULL,
   20   PRIMARY KEY ("id")
   21  );
   22 
   23 CREATE INDEX "#__workflows_idx_asset_id" ON "#__workflows" ("asset_id");
   24 CREATE INDEX "#__workflows_idx_title" ON "#__workflows" ("title");
   25 CREATE INDEX "#__workflows_idx_extension" ON "#__workflows" ("extension");
   26 CREATE INDEX "#__workflows_idx_default" ON "#__workflows" ("default");
   27 CREATE INDEX "#__workflows_idx_created" ON "#__workflows" ("created");
   28 CREATE INDEX "#__workflows_idx_created_by" ON "#__workflows" ("created_by");
   29 CREATE INDEX "#__workflows_idx_modified" ON "#__workflows" ("modified");
   30 CREATE INDEX "#__workflows_idx_modified_by" ON "#__workflows" ("modified_by");
   31 CREATE INDEX "#__workflows_idx_checked_out" ON "#__workflows" ("checked_out");
   32 
   33 INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES
   34 (1, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW', '', 'com_content.article', 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0);
   35 
   36 SELECT setval('#__workflows_id_seq', 2, false);
   37 
   38 --
   39 -- Table structure for table "#__workflow_associations"
   40 --
   41 
   42 CREATE TABLE IF NOT EXISTS "#__workflow_associations" (
   43   "item_id" bigint DEFAULT 0 NOT NULL,
   44   "stage_id" bigint DEFAULT 0 NOT NULL,
   45   "extension" varchar(50) NOT NULL,
   46   PRIMARY KEY ("item_id", "extension")
   47 );
   48 CREATE INDEX "#__workflow_associations_idx_item_stage_extension" ON "#__workflow_associations" ("item_id", "stage_id", "extension");
   49 CREATE INDEX "#__workflow_associations_idx_item_id" ON "#__workflow_associations" ("item_id");
   50 CREATE INDEX "#__workflow_associations_idx_stage_id" ON "#__workflow_associations" ("stage_id");
   51 CREATE INDEX "#__workflow_associations_idx_extension" ON "#__workflow_associations" ("extension");
   52 
   53 COMMENT ON COLUMN "#__workflow_associations"."item_id" IS 'Extension table id value';
   54 COMMENT ON COLUMN "#__workflow_associations"."stage_id" IS 'Foreign Key to #__workflow_stages.id';
   55 
   56 --
   57 -- Table structure for table "#__workflow_stages"
   58 --
   59 
   60 CREATE TABLE IF NOT EXISTS "#__workflow_stages" (
   61   "id" serial NOT NULL,
   62   "asset_id" bigint DEFAULT 0 NOT NULL,
   63   "ordering" bigint DEFAULT 0 NOT NULL,
   64   "workflow_id" bigint DEFAULT 0 NOT NULL,
   65   "published" smallint NOT NULL  DEFAULT 0,
   66   "title" varchar(255) NOT NULL,
   67   "description" text NOT NULL,
   68   "default" smallint NOT NULL  DEFAULT 0,
   69   "checked_out_time" timestamp without time zone,
   70   "checked_out" bigint DEFAULT 0 NOT NULL,
   71   PRIMARY KEY ("id")
   72 );
   73 CREATE INDEX "#__workflow_stages_idx_workflow_id" ON "#__workflow_stages" ("workflow_id");
   74 CREATE INDEX "#__workflow_stages_idx_title" ON "#__workflow_stages" ("title");
   75 CREATE INDEX "#__workflow_stages_idx_asset_id" ON "#__workflow_stages" ("asset_id");
   76 CREATE INDEX "#__workflow_stages_idx_default" ON "#__workflow_stages" ("default");
   77 CREATE INDEX "#__workflow_stages_idx_checked_out" ON "#__workflow_stages" ("checked_out");
   78 
   79 --
   80 -- Dumping data for table "#__workflow_stages"
   81 --
   82 
   83 INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "default", "checked_out_time", "checked_out") VALUES
   84 (1, 0, 1, 1, 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0);
   85 
   86 SELECT setval('#__workflow_stages_id_seq', 2, false);
   87 
   88 --
   89 -- Table structure for table "#__workflow_transitions"
   90 --
   91 
   92 CREATE TABLE IF NOT EXISTS "#__workflow_transitions" (
   93   "id" serial NOT NULL,
   94   "asset_id" bigint DEFAULT 0 NOT NULL,
   95   "ordering" bigint DEFAULT 0 NOT NULL,
   96   "workflow_id" bigint DEFAULT 0 NOT NULL,
   97   "published" smallint NOT NULL  DEFAULT 0,
   98   "title" varchar(255) NOT NULL,
   99   "description" text NOT NULL,
  100   "from_stage_id" bigint DEFAULT 0 NOT NULL,
  101   "to_stage_id" bigint DEFAULT 0 NOT NULL,
  102   "options" text NOT NULL,
  103   "checked_out_time" timestamp without time zone,
  104   "checked_out" bigint DEFAULT 0 NOT NULL,
  105   PRIMARY KEY ("id")
  106  );
  107 CREATE INDEX "#__workflow_transitions_idx_title" ON "#__workflow_transitions" ("title");
  108 CREATE INDEX "#__workflow_transitions_idx_asset_id" ON "#__workflow_transitions" ("asset_id");
  109 CREATE INDEX "#__workflow_transitions_idx_from_stage_id" ON "#__workflow_transitions" ("from_stage_id");
  110 CREATE INDEX "#__workflow_transitions_idx_to_stage_id" ON "#__workflow_transitions" ("to_stage_id");
  111 CREATE INDEX "#__workflow_transitions_idx_workflow_id" ON "#__workflow_transitions" ("workflow_id");
  112 CREATE INDEX "#__workflow_transitions_idx_checked_out" ON "#__workflow_transitions" ("checked_out");
  113 
  114 INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "options", "checked_out_time", "checked_out") VALUES
  115 (1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '{"publishing":"0"}', NULL, 0),
  116 (2, 0, 1, 2, 1, 'Publish', '', -1, 1, '{"publishing":"1"}', NULL, 0),
  117 (3, 0, 1, 3, 1, 'Trash', '', -1, 1, '{"publishing":"-2"}', NULL, 0),
  118 (4, 0, 1, 4, 1, 'Archive', '', -1, 1, '{"publishing":"2"}', NULL, 0),
  119 (5, 0, 1, 5, 1, 'Feature', '', -1, 1, '{"featuring":"1"}', NULL, 0),
  120 (6, 0, 1, 6, 1, 'Unfeature', '', -1, 1, '{"featuring":"0"}', NULL, 0),
  121 (7, 0, 1, 7, 1, 'Publish & Feature', '', -1, 1, '{"publishing":"1","featuring":"1"}', NULL, 0);
  122 
  123 SELECT setval('#__workflow_transitions_id_seq', 8, false);
  124 
  125 --
  126 -- Creating extension entry
  127 --
  128 -- Note that the old pseudo null dates have to be used for the "checked_out_time"
  129 -- column because the conversion to real null dates will be done with a later
  130 -- update SQL script.
  131 --
  132 
  133 INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
  134 (0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 1, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0),
  135 (0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0),
  136 (0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0),
  137 (0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0);
  138 
  139 --
  140 -- Creating Associations for existing content
  141 --
  142 INSERT INTO "#__workflow_associations" ("item_id", "stage_id", "extension")
  143 SELECT "id", 1, 'com_content.article' FROM "#__content";