Browse Source

Adding transaction id see BT#4882

Julio Montoya 12 years ago
parent
commit
e5c33ecf76
2 changed files with 6 additions and 5 deletions
  1. 4 3
      main/install/db_main.sql
  2. 2 2
      main/install/migrate-db-1.9.0-1.10.0-pre.sql

+ 4 - 3
main/install/db_main.sql

@@ -3090,7 +3090,8 @@ CREATE TABLE usergroup_rel_question (
 
 DROP TABLE IF EXISTS migration_transaction;
 CREATE TABLE migration_transaction (
-    id int not null AUTO_INCREMENT,
+    id bigint unsigned not null AUTO_INCREMENT,
+    transaction_id bigint unsigned,
     branch_id int not null default 0,
     action char(20),
     item_id char(36),
@@ -3099,7 +3100,7 @@ CREATE TABLE migration_transaction (
     status_id tinyint not null default 0,
     time_insert datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     time_update datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-    PRIMARY KEY (id, branch_id)
+    PRIMARY KEY (id, transaction_id, branch_id)
 );
 
 DROP TABLE IF EXISTS migration_transaction_status;
@@ -3111,4 +3112,4 @@ CREATE TABLE migration_transaction_status (
 INSERT INTO migration_transaction_status VALUES (1, 'To be executed'), (2, 'Executed successfully'), (3, 'Execution deprecated'), (4, 'Execution failed');
 
 -- Do not move this 
-UPDATE settings_current SET selected_value = '1.10.0.20339' WHERE variable = 'chamilo_database_version';
+UPDATE settings_current SET selected_value = '1.10.0.20356' WHERE variable = 'chamilo_database_version';

+ 2 - 2
main/install/migrate-db-1.9.0-1.10.0-pre.sql

@@ -109,7 +109,7 @@ ALTER TABLE gradebook_link ADD COLUMN evaluation_type_id INT NOT NULL DEFAULT 0;
 
 INSERT INTO settings_options(variable,value,display_text) VALUES ('last_transaction_id','0');
 
-CREATE TABLE migration_transaction (id int not null AUTO_INCREMENT,  branch_id int not null default 0,  action char(20),  item_id char(36),  orig_id char(36),  dest_id char(36),  status_id tinyint not null default 0,  time_insert datetime NOT NULL DEFAULT '0000-00-00 00:00:00',  time_update datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id, branch_id));
+CREATE TABLE migration_transaction (id bigint unsigned not null AUTO_INCREMENT,   transaction_id bigint unsigned, branch_id int not null default 0,  action char(20),  item_id char(36),  orig_id char(36),  dest_id char(36),  status_id tinyint not null default 0,  time_insert datetime NOT NULL DEFAULT '0000-00-00 00:00:00',  time_update datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id, transaction_id, branch_id));
 CREATE TABLE migration_transaction_status (  id tinyint not null PRIMARY KEY AUTO_INCREMENT,  title char(20));
 INSERT INTO migration_transaction_status VALUES (1, 'To be executed'), (2, 'Executed successfully'), (3, 'Execution deprecated'), (4, 'Execution failed');
 
@@ -117,4 +117,4 @@ INSERT INTO migration_transaction_status VALUES (1, 'To be executed'), (2, 'Exec
 
 
 -- Do not move this 
-UPDATE settings_current SET selected_value = '1.10.0.20339' WHERE variable = 'chamilo_database_version';
+UPDATE settings_current SET selected_value = '1.10.0.20356' WHERE variable = 'chamilo_database_version';