-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script added for table 'users' (#5722)
* Script added for table 'users' Signed-off-by: root <swale@msystechnologies.com> * updated down script Signed-off-by: root <swale@msystechnologies.com> * updated up script Signed-off-by: root <swale@msystechnologies.com> * updated up script Signed-off-by: root <swale@msystechnologies.com>
- Loading branch information
1 parent
d2b2fde
commit b943b9a
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
components/infra-proxy-service/storage/postgres/migration/sql/05_user_management.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- drop column projects in servers table | ||
ALTER TABLE servers DROP COLUMN projects; | ||
|
||
-- drop table users | ||
DROP TABLE IF EXISTS users; |
18 changes: 18 additions & 0 deletions
18
components/infra-proxy-service/storage/postgres/migration/sql/05_user_management.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- add projects column | ||
ALTER TABLE servers ADD COLUMN projects TEXT[] NOT NULL DEFAULT '{}'; | ||
|
||
-- create table users | ||
CREATE TABLE IF NOT EXISTS users ( | ||
id TEXT PRIMARY KEY, | ||
server_id TEXT NOT NULL references servers(id) ON DELETE RESTRICT, | ||
infra_server_username TEXT NOT NULL DEFAULT '', | ||
credential_id TEXT NOT NULL DEFAULT '', | ||
connector TEXT NOT NULL DEFAULT 'local', | ||
automate_user_id TEXT NOT NULL DEFAULT '', | ||
is_server_admin BOOLEAN NOT NULL DEFAULT FALSE, | ||
created_at TIMESTAMPTZ NOT NULL, | ||
updated_at TIMESTAMPTZ NOT NULL, | ||
CONSTRAINT infra_server_username_server_id_key | ||
UNIQUE(infra_server_username,server_id) | ||
); | ||
CREATE INDEX IF NOT EXISTS users_automate_user_id_index ON users (automate_user_id); |