This repository has been archived by the owner on Sep 22, 2020. It is now read-only.
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
ae3a481
commit b87b38c
Showing
7 changed files
with
88 additions
and
6 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
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,17 @@ | ||
/** | ||
* Exports | ||
*/ | ||
module.exports = function( sequelize, DataTypes ) { | ||
return sequelize.define( "ReferrerCode", { | ||
referrer: { | ||
type: DataTypes.STRING | ||
}, | ||
userStatus: { | ||
type: DataTypes.ENUM, | ||
values: ['new', 'existing'] | ||
} | ||
}, { | ||
charset: 'utf8', | ||
collate: 'utf8_general_ci' | ||
}); | ||
}; |
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
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,4 @@ | ||
# Create the new table, then migrate the existing data | ||
CREATE TABLE `ReferrerCodes` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `referrer` VARCHAR(255), `userStatus` TEXT, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `UserId` INTEGER); | ||
INSERT INTO `ReferrerCodes` (`referrer`, `userStatus`, `createdAt`, `updatedAt`, `UserId`) | ||
SELECT referrer, 'new' as userStatus, createdAt, createdAt, id FROM Users WHERE referrer IS NOT NULL; |
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,2 @@ | ||
ALTER TABLE `Users` | ||
DROP COLUMN `referrer`; |