diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8728f9c..2dbed5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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. diff --git a/migrations/202407221559__create_users_roles_table_ddl.sql b/migrations/202407221559__create_users_roles_table_ddl.sql new file mode 100644 index 0000000..bbb3af9 --- /dev/null +++ b/migrations/202407221559__create_users_roles_table_ddl.sql @@ -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) +); \ No newline at end of file diff --git a/migrations/202408061521__create_client_account_and_company_table_ddl.sql b/migrations/202408061521__create_client_account_and_company_table_ddl.sql new file mode 100644 index 0000000..aa817dc --- /dev/null +++ b/migrations/202408061521__create_client_account_and_company_table_ddl.sql @@ -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; \ No newline at end of file