Created
May 22, 2022 15:50
-
-
Save sonAndrew/680997c46db6e49554af22f263db7dfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ALTER TABLE [dbo].[user_roles] | |
| ADD id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [availablities] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| user_role_id INT NOT NULL REFERENCES [dbo].[users](id), | |
| shift_id INT NOT NULL REFERENCES [dbo].[shifts](id), | |
| department_id INT NOT NULL REFERENCES [dbo].[departments](id), | |
| location_id INT NOT NULL REFERENCES [dbo].[locations](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [cities] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) NOT NULL | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [companies] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) NOT NULL, | |
| city_id INT NOT NULL REFERENCES [dbo].[cities](id), | |
| industry_id INT NOT NULL REFERENCES [dbo].[industries](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [days] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [departments] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [industries] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [locations] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [positions] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [reports] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| title VARCHAR(50) NOT NULL, | |
| summary VARCHAR(128) NOT NULL, | |
| introduction VARCHAR(128) NOT NULL, | |
| body VARCHAR(256) NOT NULL, | |
| department_id INT NOT NULL REFERENCES [dbo].[departments](id), | |
| user_id INT NOT NULL REFERENCES [dbo].[users](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [roles] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [schedules] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) NOT NULL, | |
| department_id INT NOT NULL REFERENCES [dbo].[departments](id), | |
| position_id INT NOT NULL REFERENCES [dbo].[positions](id), | |
| total_hours INT NOT NULL, | |
| day_id INT NOT NULL REFERENCES [dbo].[days](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [shifts] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [teams] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| name VARCHAR(50) NOT NULL, | |
| user_roles INT NOT NULL REFERENCES [dbo].[user_roles](id), | |
| department_id INT NOT NULL REFERENCES [dbo].[departments](id), | |
| location_id INT NOT NULL REFERENCES [dbo].[locations](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [user_roles] | |
| ( | |
| user_id INT NOT NULL REFERENCES [dbo].[users](id), | |
| role_id INT NOT NULL REFERENCES [dbo].[roles](id) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE [users] | |
| ( | |
| id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY, | |
| first_name VARCHAR(50) NOT NULL, | |
| last_name VARCHAR(50) NOT NULL, | |
| email VARCHAR(100) NOT NULL, | |
| role_id INT NOT NULL REFERENCES [dbo].[roles](id), | |
| position_id INT NOT NULL REFERENCES [dbo].[positions](id), | |
| department_id INT NOT NULL REFERENCES [dbo].[departments](id) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment