mirror of
https://github.com/bitwarden/server.git
synced 2025-02-28 03:51:23 +01: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 * Rename User.sql to user.sql * PostgreSQL views, snake_case column fix for user_create, rename of users.sql file to lowercase
This commit is contained in:
parent
ba6baa3caa
commit
79ffda0377
@ -46,7 +46,7 @@ BEGIN
|
||||
culture,
|
||||
security_stamp,
|
||||
two_factor_providers,
|
||||
two_factor_recoverycode,
|
||||
two_factor_recovery_code,
|
||||
equivalent_domains,
|
||||
excluded_global_equivalent_domains,
|
||||
account_revision_date,
|
||||
|
6
src/Sql/PostgreSQL/Views/cipher_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/cipher_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW cipher_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
cipher;
|
6
src/Sql/PostgreSQL/Views/collection_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/collection_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW collection_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
collection;
|
6
src/Sql/PostgreSQL/Views/device_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/device_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW device_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
device;
|
6
src/Sql/PostgreSQL/Views/event_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/event_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW event_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
event;
|
6
src/Sql/PostgreSQL/Views/folder_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/folder_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW folder_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
folder;
|
6
src/Sql/PostgreSQL/Views/grant_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/grant_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW grant_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
"grant";
|
6
src/Sql/PostgreSQL/Views/group_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/group_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW group_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
"group";
|
6
src/Sql/PostgreSQL/Views/installation_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/installation_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW installation_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
installation;
|
@ -0,0 +1,25 @@
|
||||
CREATE VIEW organization_user_organization_details_view
|
||||
AS
|
||||
SELECT
|
||||
ou.user_id,
|
||||
ou.organization_id,
|
||||
o.name,
|
||||
o.enabled,
|
||||
o.use_groups,
|
||||
o.use_directory,
|
||||
o.use_events,
|
||||
o.use_totp,
|
||||
o.use_2fa,
|
||||
o.use_api,
|
||||
o.self_host,
|
||||
o.users_get_premium,
|
||||
o.seats,
|
||||
o.max_collections,
|
||||
o.max_storage_gb,
|
||||
ou.key,
|
||||
ou.status,
|
||||
ou.type
|
||||
FROM
|
||||
organization_user ou
|
||||
INNER JOIN
|
||||
organization o ON o.id = ou.organization_id;
|
@ -0,0 +1,18 @@
|
||||
CREATE VIEW organization_user_user_details_view
|
||||
AS
|
||||
SELECT
|
||||
ou.id,
|
||||
ou.user_id,
|
||||
ou.organization_id,
|
||||
u.name,
|
||||
coalesce(u.email, ou.email) email,
|
||||
u.two_factor_providers,
|
||||
u.premium,
|
||||
ou.status,
|
||||
ou.type,
|
||||
ou.access_all,
|
||||
ou.external_id
|
||||
FROM
|
||||
organization_user ou
|
||||
LEFT JOIN
|
||||
"user" u ON U.id = ou.user_id;
|
6
src/Sql/PostgreSQL/Views/organization_user_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/organization_user_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW organization_user_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
organization_user;
|
6
src/Sql/PostgreSQL/Views/organization_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/organization_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW organization_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
organization;
|
6
src/Sql/PostgreSQL/Views/transaction_view.sql
Normal file
6
src/Sql/PostgreSQL/Views/transaction_view.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW transaction_view
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
transaction;
|
Loading…
Reference in New Issue
Block a user