Files
configcenter/internal/store/postgres/migrations/002_auth_gray.sql

11 lines
536 B
SQL

ALTER TABLE users ADD COLUMN IF NOT EXISTS is_admin BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE users ADD COLUMN IF NOT EXISTS disabled BOOLEAN NOT NULL DEFAULT false;
CREATE INDEX IF NOT EXISTS user_app_roles_app_idx ON user_app_roles(app_id, user_id);
ALTER TABLE gray_rules ADD COLUMN IF NOT EXISTS priority INT NOT NULL DEFAULT 0;
ALTER TABLE gray_rules ADD COLUMN IF NOT EXISTS description TEXT NOT NULL DEFAULT '';
CREATE INDEX IF NOT EXISTS gray_rules_scope_idx
ON gray_rules(namespace_id, env_id, enabled, priority, id);