mirror of
https://github.com/bitwarden/server
synced 2025-12-28 06:03:29 +00: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
This commit is contained in:
19
src/Sql/PostgreSQL/Tables/collection.sql
Normal file
19
src/Sql/PostgreSQL/Tables/collection.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
DROP TABLE IF EXISTS collection;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS collection (
|
||||
id UUID NOT NULL,
|
||||
organization_id UUID NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
external_id VARCHAR (300) NULL,
|
||||
creation_date TIMESTAMPTZ NOT NULL,
|
||||
revision_date TIMESTAMPTZ NOT NULL,
|
||||
CONSTRAINT pk_collection PRIMARY KEY (id),
|
||||
CONSTRAINT fk_collection_organization FOREIGN KEY (organization_id) REFERENCES organization (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX ix_collection_organization_id_include_all
|
||||
ON collection(organization_id ASC)
|
||||
INCLUDE(creation_date, name, revision_date);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user