1
0
mirror of https://github.com/bitwarden/server synced 2025-12-28 06:03:29 +00:00

#453 Added PostgreSQL initial db scripts (User) (#556)

* 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:
Papina
2019-09-12 03:38:46 +10:00
committed by Kyle Spearrin
parent 12c8e4b124
commit 5000de6fa8
24 changed files with 543 additions and 4 deletions

View 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);