Permalink
Browse files

New tables - upgrade script - Fix #1231 Fix #1232

  • Loading branch information...
1 parent e0acdd8 commit d0f212019c22824177f27d690a8c71be65db1e8e @cdujeu cdujeu committed Oct 7, 2016
Showing with 59 additions and 29 deletions.
  1. +33 −23 dist/php/6.5.4.mysql
  2. +13 −3 dist/php/6.5.4.pgsql
  3. +13 −3 dist/php/6.5.4.sqlite
View
@@ -2,26 +2,24 @@
DROP TABLE IF EXISTS ajxp_tasks;
/* SEPARATOR */
CREATE TABLE IF NOT EXISTS ajxp_tasks (
- uid VARCHAR(255) NOT NULL ,
- type INTEGER NOT NULL,
- parent_uid VARCHAR(255) DEFAULT NULL,
- flags INTEGER NOT NULL,
- label VARCHAR(255) NOT NULL,
- user_id VARCHAR(255) NOT NULL,
- ws_id VARCHAR(32) NOT NULL,
- status INTEGER NOT NULL,
- status_msg VARCHAR(500) NOT NULL,
- progress INTEGER NOT NULL,
- schedule INTEGER NOT NULL,
- schedule_value VARCHAR(255) DEFAULT NULL,
- action VARCHAR(255) NOT NULL,
- parameters VARCHAR(500) NOT NULL,
- nodes VARCHAR(500) NOT NULL,
- creation_date INTEGER NOT NULL DEFAULT 0,
- status_update INTEGER NOT NULL DEFAULT 0,
-
- PRIMARY KEY (uid)
-) DEFAULT CHARSET=utf8;
+ uid VARCHAR(40) NOT NULL,
+ `type` INTEGER NOT NULL,
+ parent_uid VARCHAR(40) DEFAULT NULL,
+ flags INTEGER NOT NULL,
+ label VARCHAR(255) NOT NULL,
+ user_id VARCHAR(255) NOT NULL,
+ ws_id VARCHAR(32) NOT NULL,
+ status INTEGER NOT NULL,
+ status_msg VARCHAR(500) NOT NULL,
+ progress INTEGER NOT NULL,
+ schedule INTEGER NOT NULL,
+ schedule_value VARCHAR(255) DEFAULT NULL,
+ `action` VARCHAR(255) NOT NULL,
+ parameters MEDIUMBLOB NOT NULL,
+ creation_date INTEGER NOT NULL DEFAULT 0,
+ status_update INTEGER NOT NULL DEFAULT 0,
+ PRIMARY KEY (uid)
+) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
/* SEPARATOR */
CREATE INDEX ajxp_task_usr_idx ON ajxp_tasks (user_id);
/* SEPARATOR */
@@ -31,15 +29,27 @@ CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
/* SEPARATOR */
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
/* SEPARATOR */
-CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
+CREATE TABLE IF NOT EXISTS `ajxp_tasks_nodes` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `task_uid` varchar(40) NOT NULL,
+ `node_base_url` varchar(255) NOT NULL,
+ `node_path` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`)
+) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
/* SEPARATOR */
-DROP TABLE IF EXISTS `ajxp_mq_queues`;
+CREATE INDEX ajxp_taskn_tuid_idx ON ajxp_tasks_nodes (task_uid);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_base_idx ON ajxp_tasks_nodes (node_base_url);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_path_idx ON ajxp_tasks_nodes (node_path);
+/* SEPARATOR */
+DROP TABLE IF EXISTS ajxp_mq_queues;
/* SEPARATOR */
CREATE TABLE IF NOT EXISTS `ajxp_mq_queues` (
`channel_name` varchar(255) NOT NULL,
`content` LONGBLOB NOT NULL,
PRIMARY KEY (`channel_name`)
-) DEFAULT CHARSET=utf8;
+) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
/* SEPARATOR */
DROP TRIGGER IF EXISTS `LOG_UPDATE`;
/* SEPARATOR */
View
@@ -15,8 +15,7 @@ CREATE TABLE IF NOT EXISTS ajxp_tasks (
schedule INTEGER NOT NULL,
schedule_value VARCHAR(255) DEFAULT NULL,
action VARCHAR(255) NOT NULL,
- parameters VARCHAR(500) NOT NULL,
- nodes VARCHAR(500) NOT NULL,
+ parameters BYTEA NOT NULL,
creation_date INTEGER NOT NULL DEFAULT 0,
status_update INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (uid)
@@ -30,7 +29,18 @@ CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
/* SEPARATOR */
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
/* SEPARATOR */
-CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
+CREATE TABLE IF NOT EXISTS ajxp_tasks_nodes (
+ id serial PRIMARY KEY,
+ task_uid VARCHAR(40) NOT NULL,
+ node_base_url VARCHAR(255) NOT NULL,
+ node_path VARCHAR(255) NOT NULL
+);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_tuid_idx ON ajxp_tasks_nodes (task_uid);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_base_idx ON ajxp_tasks_nodes (node_base_url);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_path_idx ON ajxp_tasks_nodes (node_path);
/* SEPARATOR */
CREATE TABLE IF NOT EXISTS ajxp_mq_queues (
channel_name varchar(255) NOT NULL,
View
@@ -14,8 +14,7 @@ CREATE TABLE IF NOT EXISTS ajxp_tasks (
schedule INTEGER NOT NULL,
schedule_value VARCHAR(255) DEFAULT NULL,
action VARCHAR(255) NOT NULL,
- parameters VARCHAR(500) NOT NULL,
- nodes VARCHAR(500) NOT NULL,
+ parameters TEXT NOT NULL,
creation_date INTEGER NOT NULL DEFAULT 0,
status_update INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (uid)
@@ -29,7 +28,18 @@ CREATE INDEX ajxp_task_type ON ajxp_tasks (type);
/* SEPARATOR */
CREATE INDEX ajxp_task_schedule ON ajxp_tasks (schedule);
/* SEPARATOR */
-CREATE INDEX ajxp_task_nodes_idx ON ajxp_tasks (nodes);
+CREATE TABLE IF NOT EXISTS ajxp_tasks_nodes (
+ id integer NOT NULL primary key autoincrement,
+ task_uid TEXT NOT NULL,
+ node_base_url TEXT NOT NULL,
+ node_path TEXT NOT NULL
+);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_tuid_idx ON ajxp_tasks_nodes (task_uid);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_base_idx ON ajxp_tasks_nodes (node_base_url);
+/* SEPARATOR */
+CREATE INDEX ajxp_taskn_path_idx ON ajxp_tasks_nodes (node_path);
/* SEPARATOR */
CREATE TABLE IF NOT EXISTS ajxp_mq_queues (
channel_name varchar(255) NOT NULL,

0 comments on commit d0f2120

Please sign in to comment.