CONSTRAINT cb_name_once_per_owner UNIQUE (owner,name,btype)
);
+CREATE TABLE container.copy_bucket_note (
+ id SERIAL PRIMARY KEY,
+ bucket INT NOT NULL REFERENCES container.copy_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
CREATE TABLE container.copy_bucket_item (
id SERIAL PRIMARY KEY,
bucket INT NOT NULL
ON UPDATE CASCADE
DEFERRABLE
INITIALLY DEFERRED,
+ pos INT,
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
+CREATE TABLE container.copy_bucket_item_note (
+ id SERIAL PRIMARY KEY,
+ item INT NOT NULL REFERENCES container.copy_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
CONSTRAINT cnb_name_once_per_owner UNIQUE (owner,name,btype)
);
+CREATE TABLE container.call_number_bucket_note (
+ id SERIAL PRIMARY KEY,
+ bucket INT NOT NULL REFERENCES container.call_number_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
CREATE TABLE container.call_number_bucket_item (
id SERIAL PRIMARY KEY,
bucket INT NOT NULL
ON UPDATE CASCADE
DEFERRABLE
INITIALLY DEFERRED,
+ pos INT,
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
+CREATE TABLE container.call_number_bucket_item_note (
+ id SERIAL PRIMARY KEY,
+ item INT NOT NULL REFERENCES container.call_number_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
+
CREATE TABLE container.biblio_record_entry_bucket_type (
CONSTRAINT breb_name_once_per_owner UNIQUE (owner,name,btype)
);
+CREATE TABLE container.biblio_record_entry_bucket_note (
+ id SERIAL PRIMARY KEY,
+ bucket INT NOT NULL REFERENCES container.biblio_record_entry_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
CREATE TABLE container.biblio_record_entry_bucket_item (
id SERIAL PRIMARY KEY,
bucket INT NOT NULL
ON UPDATE CASCADE
DEFERRABLE
INITIALLY DEFERRED,
+ pos INT,
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
+CREATE TABLE container.biblio_record_entry_bucket_item_note (
+ id SERIAL PRIMARY KEY,
+ item INT NOT NULL REFERENCES container.biblio_record_entry_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
CREATE TABLE container.user_bucket_type (
CONSTRAINT ub_name_once_per_owner UNIQUE (owner,name,btype)
);
+CREATE TABLE container.user_bucket_note (
+ id SERIAL PRIMARY KEY,
+ bucket INT NOT NULL REFERENCES container.user_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
CREATE TABLE container.user_bucket_item (
id SERIAL PRIMARY KEY,
bucket INT NOT NULL
ON UPDATE CASCADE
DEFERRABLE
INITIALLY DEFERRED,
+ pos INT,
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
+CREATE TABLE container.user_bucket_item_note (
+ id SERIAL PRIMARY KEY,
+ item INT NOT NULL REFERENCES container.user_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ note TEXT NOT NULL
+);
+
+
COMMIT;