Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script added for table 'org_users' #5738

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);