Skip to content

Tms step1 sql review #11

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
environment: test
env:
BYTEBASE_URL: https://demo.bytebase.com
BYTEBASE_SERVICE_ACCOUNT: ci@service.bytebase.com
BYTEBASE_URL: https://github.com/songtvo/example-gitops-github-flow
BYTEBASE_SERVICE_ACCOUNT: api-sample@service.bytebase.com
BYTEBASE_PROJECT: "projects/project-sample"
# The Bytebase rollout pipeline will deploy to 'test' and 'prod' environments.
# 'deploy-to-test' job rollouts the 'test' stage and 'deploy-to-prod' job rollouts the 'prod' stage.
Expand Down
14 changes: 14 additions & 0 deletions migrations/202407221559__create_users_roles_table_ddl.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE users
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL UNIQUE,
is_not_locked BOOLEAN DEFAULT TRUE,
is_temporary_password BOOLEAN DEFAULT TRUE,
avatar VARCHAR(255),
created_date DATETIME,
created_by VARCHAR(36),
updated_date DATETIME,
updated_by VARCHAR(36)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
CREATE TABLE client_account
(
id BIGINT PRIMARY KEY AUTO_INCREMENT,
client_account_id VARCHAR(20) NOT NULL UNIQUE,
client_account_name VARCHAR(100) NOT NULL,
address VARCHAR(250),
country VARCHAR(3),
state VARCHAR(50),
city VARCHAR(50),
postcode BIGINT,
phone_country_code VARCHAR(20),
phone VARCHAR(20),
email_address VARCHAR(70),
status VARCHAR(1),
start_date DATETIME NOT NULL,
contact_name VARCHAR(100),
contact_phone_country_code VARCHAR(20),
contact_phone VARCHAR(20),
contact_email_address VARCHAR(70),
client_common_db_name VARCHAR(255) NOT NULL UNIQUE,
created_date DATETIME,
created_by VARCHAR(36),
updated_date DATETIME,
updated_by VARCHAR(36)
);


CREATE TABLE company
(
id BIGINT PRIMARY KEY AUTO_INCREMENT,
client_id BIGINT NOT NULL,
company_code VARCHAR(50) NOT NULL,
it_company_code varchar(100) DEFAULT '' NOT NULL,
company_name VARCHAR(255) NOT NULL,
status VARCHAR(1),
company_db_name VARCHAR(255) NOT NULL UNIQUE,
created_date DATETIME,
created_by VARCHAR(36),
updated_date DATETIME,
updated_by VARCHAR(36),
CONSTRAINT uk_company_code_client_id UNIQUE (company_code, client_id)
);

ALTER TABLE company
ADD CONSTRAINT fk_client_account FOREIGN KEY (client_id) REFERENCES client_account (id)
ON UPDATE CASCADE;