Skip to content
Permalink
Browse files

Added eav db details to db init script for postgres.

  • Loading branch information...
csrster committed Dec 22, 2015
1 parent 3d07a5a commit dbc2364800992a1c681d18f0597e2114b2c5e822
Showing with 41 additions and 0 deletions.
  1. +41 −0 deploy/deploy-core/scripts/postgresql/netarchivesuite_init.sql
@@ -102,6 +102,11 @@ INSERT INTO schemaversions ( tablename, version )
VALUES ( 'extendedfieldhistoryvalue', 1);
INSERT INTO schemaversions ( tablename, version )
VALUES ( 'harvestchannel', 1);
INSERT INTO schemaversions ( tablename, version )
VALUES ( 'eav_attribute', 1);
INSERT INTO schemaversions ( tablename, version )
VALUES ( 'eav_type_attribute', 1);



GRANT SELECT,INSERT,UPDATE,DELETE ON TABLE schemaversions TO netarchivesuite;
@@ -613,3 +618,39 @@ ALTER TABLE extendedfield ALTER COLUMN options TYPE VARCHAR(1000);

ALTER TABLE extendedfieldvalue ALTER COLUMN content TYPE VARCHAR(30000);
ALTER TABLE extendedfieldvalue ALTER COLUMN content SET NOT NULL;

CREATE TABLE eav_type_attribute (
tree_id INTEGER NOT NULL,
id INTEGER NOT NULL,
name VARCHAR(96) NOT NULL,
class_namespace VARCHAR(96) NOT NULL,
class_name VARCHAR(96) NOT NULL,
datatype INTEGER NOT NULL,
viewtype INTEGER NOT NULL,
def_int INTEGER NULL,
def_datetime TIMESTAMP NULL,
def_varchar VARCHAR(8000) NULL,
def_text TEXT NULL
);

ALTER TABLE eav_type_attribute ADD CONSTRAINT eav_type_attribute_pkey PRIMARY KEY (tree_id, id);

CREATE UNIQUE INDEX eav_type_attribute_idx on eav_type_attribute(tree_id, id) TABLESPACE tsindex;

CREATE SEQUENCE eav_attribute_seq;

CREATE TABLE eav_attribute (
tree_id INTEGER NOT NULL,
id INTEGER NOT NULL DEFAULT NEXTVAL('eav_attribute_seq'),
entity_id INTEGER NOT NULL,
type_id INTEGER NOT NULL,
val_int INTEGER NULL,
val_datetime TIMESTAMP NULL,
val_varchar VARCHAR(8000) NULL,
val_text TEXT NULL
);

ALTER TABLE eav_attribute ADD CONSTRAINT eav_attribute_pkey PRIMARY KEY (tree_id, id);

CREATE UNIQUE INDEX eav_attribute_idx on eav_attribute(tree_id, entity_id) TABLESPACE tsindex;

0 comments on commit dbc2364

Please sign in to comment.
You can’t perform that action at this time.