Skip to content

Commit

Permalink
Fixed #19465: ezxmlexport: inconsistency between db_schema.dba and sc…
Browse files Browse the repository at this point in the history
…hema.sql
  • Loading branch information
dpobel committed Sep 4, 2012
1 parent cbbc746 commit 60ffd94
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 61 deletions.
20 changes: 10 additions & 10 deletions share/db_schema.dba
Expand Up @@ -23,7 +23,7 @@ $schema = array (
),
'indexes' =>
array (
'contentclass_attribute_id' =>
'idx_contentclass_attribute_id' =>
array (
'type' => 'unique',
'fields' =>
Expand Down Expand Up @@ -56,7 +56,7 @@ $schema = array (
),
'indexes' =>
array (
'contentclass_id' =>
'idx_contentclass_id' =>
array (
'type' => 'unique',
'fields' =>
Expand All @@ -73,9 +73,9 @@ $schema = array (
array (
'ftp_target' =>
array (
'type' => 'text',
'type' => 'longtext',
'not_null' => '1',
'default' => false,
'default' => '',
),
'id' =>
array (
Expand Down Expand Up @@ -131,7 +131,7 @@ $schema = array (
),
'indexes' =>
array (
'FK_process_log_id' =>
'fk_process_log_id' =>
array (
'type' => 'non-unique',
'fields' =>
Expand Down Expand Up @@ -200,7 +200,7 @@ $schema = array (
'length' => 100,
'type' => 'varchar',
'not_null' => '1',
'default' => '0',
'default' => '',
),
'ftp_target' =>
array (
Expand Down Expand Up @@ -237,9 +237,9 @@ $schema = array (
),
'sources' =>
array (
'type' => 'text',
'type' => 'longtext',
'not_null' => '1',
'default' => false,
'default' => '',
),
'start_date' =>
array (
Expand All @@ -252,7 +252,7 @@ $schema = array (
array (
'length' => 70,
'type' => 'varchar',
'not_null' => '0',
'not_null' => 0,
'default' => '',
),
),
Expand Down Expand Up @@ -354,4 +354,4 @@ $data = array (
),
);

?>
?>
30 changes: 16 additions & 14 deletions sql/mysql/schema.sql
@@ -1,46 +1,48 @@
CREATE TABLE ezxport_available_cclass_attr (
contentclass_attribute_id int(11) NOT NULL,
contentclass_id int(11) NOT NULL,
UNIQUE KEY contentclass_attribute_id (contentclass_attribute_id)
UNIQUE KEY idx_contentclass_attribute_id (contentclass_attribute_id),
KEY fk_contentclassattribute_id (contentclass_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ezxport_available_cclasses (
contentclass_id int(11) NOT NULL,
UNIQUE KEY contentclass_id (contentclass_id)
UNIQUE KEY idx_contentclass_id (contentclass_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ezxport_customers (
id int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
ftp_target text NOT NULL,
ftp_target longtext NOT NULL,
slicing_mode CHAR(1) NOT NULL DEFAULT '1',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ezxport_export_object_log (
process_log_id int(11) NOT NULL,
contentobject_id int(11) NOT NULL,
KEY FK_process_log_id (process_log_id)
KEY fk_process_log_id (process_log_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ezxport_exports (
id int(11) NOT NULL AUTO_INCREMENT,
customer_id int(11) NOT NULL,
`name` varchar(200) NOT NULL,
description varchar(200) NOT NULL,
sources text NOT NULL,
ftp_target varchar(200) NOT NULL,
sources longtext NOT NULL,
ftp_target varchar(200) NOT NULL DEFAULT 'false',
slicing_mode CHAR(1) NOT NULL DEFAULT '1',
start_date varchar(15) NOT NULL DEFAULT '0',
end_date varchar(15) NOT NULL DEFAULT '0',
export_schedule varchar(100) NOT NULL,
export_schedule varchar(100) NOT NULL DEFAULT '',
export_limit int(11) NOT NULL,
export_from_last tinyint(4) NOT NULL DEFAULT '0',
compression tinyint(4) NOT NULL,
related_object_handling tinyint(4) NOT NULL,
xslt_file varchar(70) NOT NULL,
export_hidden_nodes tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (id)
export_from_last int(1) NOT NULL DEFAULT '0',
compression int(1) NOT NULL,
related_object_handling int(1) NOT NULL DEFAULT '0',
xslt_file varchar(70) DEFAULT '',
export_hidden_nodes int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (id),
KEY fk_customers (customer_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ezxport_process_logs (
Expand All @@ -55,4 +57,4 @@ CREATE TABLE ezxport_process_logs (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `ezxport_export_object_log`
ADD CONSTRAINT FK_process_log_id FOREIGN KEY (process_log_id) REFERENCES ezxport_process_logs (id) ON DELETE CASCADE;
ADD CONSTRAINT fk_process_log_id FOREIGN KEY (process_log_id) REFERENCES ezxport_process_logs (id) ON DELETE CASCADE;
53 changes: 29 additions & 24 deletions sql/oracle/schema.sql
@@ -1,53 +1,59 @@
CREATE TABLE ezxport_available_cclass_attr (
contentclass_attribute_id INT NOT NULL,
contentclass_id INT NOT NULL,
UNIQUE (contentclass_attribute_id ));
contentclass_attribute_id INT DEFAULT 0 NOT NULL,
contentclass_id INT DEFAULT 0 NOT NULL,
CONSTRAINT idx_contentclass_attribute_id UNIQUE (contentclass_attribute_id ));

CREATE INDEX fk_contentclassattribute_id ON ezxport_available_cclass_attr(contentclass_id);

CREATE TABLE ezxport_available_cclasses (
contentclass_id INT NOT NULL,
UNIQUE (contentclass_id ));
contentclass_id INT DEFAULT 0 NOT NULL,
CONSTRAINT idx_contentclass_id UNIQUE (contentclass_id ));

CREATE TABLE ezxport_customers (
id INT NOT NULL,
NAME VARCHAR2(200) NOT NULL,
ftp_target CLOB NOT NULL,
ftp_target CLOB DEFAULT '' NOT NULL,
slicing_mode CHAR(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_ezxport_customers PRIMARY KEY ( id ));
PRIMARY KEY ( id ));

CREATE TABLE ezxport_exports (
id INT NOT NULL,
customer_id INT NOT NULL,
customer_id INT DEFAULT 0 NOT NULL,
NAME VARCHAR2(200) NOT NULL,
description VARCHAR2(200) NOT NULL,
sources CLOB NOT NULL,
ftp_target VARCHAR2(200) NOT NULL,
sources CLOB DEFAULT '' NOT NULL,
ftp_target VARCHAR2(200) DEFAULT 'false' NOT NULL,
slicing_mode CHAR(1) DEFAULT '1' NOT NULL,
start_date VARCHAR2(15) DEFAULT '0' NOT NULL,
end_date VARCHAR2(15) DEFAULT '0' NOT NULL,
export_schedule VARCHAR2(100) NOT NULL,
export_limit INT NOT NULL,
export_from_last INT DEFAULT 0 NOT NULL,
compression INT NOT NULL,
related_object_handling INT NOT NULL,
xslt_file VARCHAR2(70) NOT NULL,
export_limit INT DEFAULT 0 NOT NULL,
export_from_last INT DEFAULT 0 NOT NULL,
compression INT DEFAULT 0 NOT NULL,
related_object_handling INT DEFAULT 0 NOT NULL,
xslt_file VARCHAR2(70),
export_hidden_nodes INT DEFAULT 0 NOT NULL,
CONSTRAINT pk_ezxport_exports PRIMARY KEY ( id ));
PRIMARY KEY ( id ));

CREATE INDEX fk_customers ON ezxport_exports(customer_id);

CREATE TABLE ezxport_process_logs (
id INT NOT NULL,
export_id INT NOT NULL,
export_id INT DEFAULT 0 NOT NULL,
start_date VARCHAR2(10) NOT NULL,
end_date VARCHAR2(10) NOT NULL,
start_id_transfert_date VARCHAR2(10) NOT NULL,
end_id_transfert_date VARCHAR2(10) NOT NULL,
status INT NOT NULL,
CONSTRAINT pk_ezxport_process_logs PRIMARY KEY ( id ));
start_transfert_date VARCHAR2(10) NOT NULL,
end_transfert_date VARCHAR2(10) NOT NULL,
status INT DEFAULT 0 NOT NULL,
PRIMARY KEY ( id ));

CREATE TABLE ezxport_export_object_log (
process_log_id INT NOT NULL,
contentobject_id INT NOT NULL,
process_log_id INT DEFAULT 0 NOT NULL,
contentobject_id INT DEFAULT 0 NOT NULL,
CONSTRAINT fk_process_log_id FOREIGN KEY ( process_log_id ) REFERENCES ezxport_process_logs(id) ON DELETE CASCADE);

CREATE INDEX fk_process_log_id ON ezxport_export_object_log(process_log_id);

CREATE SEQUENCE s_xport_customers;
CREATE SEQUENCE s_xport_exports;
CREATE SEQUENCE s_xport_process_logs;
Expand All @@ -72,4 +78,3 @@ BEGIN
SELECT s_xport_process_logs.nextval INTO :new.id FROM dual;
END;
/

33 changes: 20 additions & 13 deletions sql/postgresql/schema.sql
Expand Up @@ -22,37 +22,41 @@ CREATE SEQUENCE ezxport_process_logs_s
CREATE TABLE ezxport_available_cclass_attr (
contentclass_attribute_id INT NOT NULL,
contentclass_id INT NOT NULL,
UNIQUE (contentclass_attribute_id ));
CONSTRAINT idx_contentclass_attribute_id UNIQUE (contentclass_attribute_id ));

CREATE INDEX fk_contentclassattribute_id ON ezxport_available_cclass_attr USING btree ( contentclass_id );

CREATE TABLE ezxport_available_cclasses (
contentclass_id INT NOT NULL,
UNIQUE (contentclass_id ));
CONSTRAINT idx_contentclass_id UNIQUE (contentclass_id ));

CREATE TABLE ezxport_customers (
ID integer DEFAULT nextval('ezxport_customers_s'::text) NOT NULL,
NAME VARCHAR(200) NOT NULL,
ftp_target TEXT NOT NULL,
ftp_target TEXT DEFAULT '' NOT NULL,
slicing_mode CHAR(1) DEFAULT '1' NOT NULL,
CONSTRAINT pk_ezxport_customers PRIMARY KEY ( id ));
CONSTRAINT ezxport_customers_pkey PRIMARY KEY ( id ));

CREATE TABLE ezxport_exports (
ID integer DEFAULT nextval('ezxport_exports_s'::text) NOT NULL,
customer_id INT NOT NULL,
NAME VARCHAR(200) NOT NULL,
description VARCHAR(200) NOT NULL,
sources TEXT NOT NULL,
ftp_target VARCHAR(200) NOT NULL,
sources TEXT DEFAULT '' NOT NULL,
ftp_target VARCHAR(200) DEFAULT 'false' NOT NULL,
slicing_mode CHAR(1) DEFAULT '1' NOT NULL,
start_date VARCHAR(15) DEFAULT '0' NOT NULL,
end_date VARCHAR(15) DEFAULT '0' NOT NULL,
export_schedule VARCHAR(100) NOT NULL,
export_limit INT NOT NULL,
export_from_last SMALLINT DEFAULT '0' NOT NULL,
compression SMALLINT NOT NULL,
related_object_handling SMALLINT NOT NULL,
xslt_file VARCHAR(70) NOT NULL,
export_hidden_nodes SMALLINT DEFAULT '0' NOT NULL,
CONSTRAINT pk_ezxport_exports PRIMARY KEY ( id ));
export_from_last INT DEFAULT '0' NOT NULL,
compression INT NOT NULL,
related_object_handling INT NOT NULL,
xslt_file VARCHAR(70) DEFAULT '',
export_hidden_nodes INT DEFAULT '0' NOT NULL,
CONSTRAINT ezxport_exports_pkey PRIMARY KEY ( id ));

CREATE INDEX fk_customers ON ezxport_exports USING btree ( customer_id );

CREATE TABLE ezxport_process_logs (
ID integer DEFAULT nextval('ezxport_process_logs_s'::text) NOT NULL,
Expand All @@ -62,13 +66,16 @@ CREATE TABLE ezxport_process_logs (
start_transfert_date VARCHAR(10) NOT NULL,
end_transfert_date VARCHAR(10) NOT NULL,
status INT NOT NULL,
CONSTRAINT pk_ezxport_process_logs PRIMARY KEY ( id ));
CONSTRAINT ezxport_process_logs_pkey PRIMARY KEY ( id ));


CREATE TABLE ezxport_export_object_log (
process_log_id INT NOT NULL,
contentobject_id INT NOT NULL,
CONSTRAINT "FK_process_log_id" FOREIGN KEY ( process_log_id ) REFERENCES ezxport_process_logs(id) ON DELETE CASCADE);

CREATE INDEX fk_process_log_id ON ezxport_export_object_log USING btree ( process_log_id );

SELECT setval('ezxport_customers_s', max(id)) , 'ezxport_customers' as tablename FROM ezxport_customers;
SELECT setval('ezxport_exports_s', max(id)) , 'ezxport_exports' as tablename FROM ezxport_exports;
SELECT setval('ezxport_process_logs_s', max(id)) , 'ezxport_export_object_log' as tablename FROM ezxport_process_logs;

0 comments on commit 60ffd94

Please sign in to comment.