-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
581a873
commit 18abe8b
Showing
12 changed files
with
218 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--changeset josephspurrier:1 | ||
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | ||
CREATE TABLE user_status ( | ||
id TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
|
||
status VARCHAR(25) NOT NULL, | ||
|
||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, | ||
|
||
PRIMARY KEY (id) | ||
); | ||
--rollback DROP TABLE user_status; | ||
|
||
--changeset josephspurrier:2 | ||
INSERT INTO `user_status` (`id`, `status`, `created_at`, `updated_at`, `deleted`) VALUES | ||
(1, 'active', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0), | ||
(2, 'inactive', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0); | ||
--rollback TRUNCATE TABLE user_status; | ||
|
||
--changeset josephspurrier:3 | ||
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | ||
CREATE TABLE user ( | ||
id VARCHAR(36) NOT NULL, | ||
|
||
first_name VARCHAR(50) NOT NULL, | ||
last_name VARCHAR(50) NOT NULL, | ||
email VARCHAR(100) NOT NULL, | ||
password CHAR(60) NOT NULL, | ||
|
||
status_id TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, | ||
|
||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
deleted_at TIMESTAMP DEFAULT 0, | ||
|
||
UNIQUE KEY (email), | ||
CONSTRAINT `f_user_status` FOREIGN KEY (`status_id`) REFERENCES `user_status` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
|
||
PRIMARY KEY (id) | ||
); | ||
--rollback DROP TABLE user; |