mirror of
https://github.com/bitwarden/server.git
synced 2025-05-29 23:34:53 -05:00

* PostgreSQL initial commit of translation from SQL Server to PostgreSQL * snake_case added. set search path for schema. schema qualified name no longer needed for creation and access of functions. * Table DDL for PostgreSQL
12 lines
537 B
SQL
12 lines
537 B
SQL
DROP TABLE IF EXISTS collection_user;
|
|
|
|
CREATE TABLE IF NOT EXISTS collection_user (
|
|
collection_id UUID NOT NULL,
|
|
organization_user_id UUID NOT NULL,
|
|
read_only BIT NOT NULL,
|
|
CONSTRAINT pk_collection_user PRIMARY KEY (collection_id, organization_user_id),
|
|
CONSTRAINT fk_collection_user_collection FOREIGN KEY (collection_id) REFERENCES collection (id) ON DELETE CASCADE,
|
|
CONSTRAINT fk_collection_user_organization_user FOREIGN KEY (organization_user_id) REFERENCES organization_user (id)
|
|
);
|
|
|