Skip to content

Commit

Permalink
Script added for table 'org_users' (#5738)
Browse files Browse the repository at this point in the history
Signed-off-by: root <swale@msystechnologies.com>
  • Loading branch information
sonali523 authored and vinay033 committed Mar 3, 2022
1 parent 13b6709 commit a34604c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- drop column projects in servers table
ALTER TABLE servers DROP COLUMN projects;

-- drop table org_users
DROP TABLE IF EXISTS org_users;

-- drop table users
DROP TABLE IF EXISTS users;
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ CREATE TABLE IF NOT EXISTS users (
UNIQUE(infra_server_username,server_id)
);
CREATE INDEX IF NOT EXISTS users_automate_user_id_index ON users (automate_user_id);

-- create table org_users
CREATE TABLE IF NOT EXISTS org_users (
id TEXT PRIMARY KEY,
org_id TEXT NOT NULL references orgs(id) ON DELETE RESTRICT,
user_id TEXT NOT NULL references users(id) ON DELETE RESTRICT,
is_admin BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE INDEX IF NOT EXISTS org_users_org_id_index ON org_users (org_id);
CREATE INDEX IF NOT EXISTS org_users_user_id_index ON org_users (user_id);

0 comments on commit a34604c

Please sign in to comment.