-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from story-squad/update/words
Update/words
- Loading branch information
Showing
142 changed files
with
561 additions
and
497 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// rename the "Played" table to "Score" | ||
|
||
exports.up = function (knex) { | ||
return knex.schema.renameTable("Words", "words"); | ||
}; | ||
|
||
exports.down = function (knex) { | ||
return knex.schema.renameTable("words", "Words"); | ||
}; |
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,23 @@ | ||
const tableName = "words"; | ||
// alter score table to include timestamps & points | ||
exports.up = async function (knex) { | ||
await knex.schema.alterTable(tableName, function (tbl) { | ||
// add timestamps | ||
tbl.timestamps(false, true); | ||
tbl.string("format", 255).defaultTo("word"); | ||
}); | ||
|
||
await knex.raw(` | ||
CREATE TRIGGER update_timestamp | ||
BEFORE UPDATE | ||
ON ${tableName} | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE update_timestamp();`); | ||
}; | ||
|
||
exports.down = async function (knex) { | ||
await knex.schema.alterTable(tableName, function (tbl) { | ||
tbl.dropTimestamps(); | ||
tbl.dropColumns(["format"]); | ||
}); | ||
}; |
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,9 @@ | ||
// rename the "Played" table to "Score" | ||
|
||
exports.up = function (knex) { | ||
return knex.schema.renameTable("Words", "words"); | ||
}; | ||
|
||
exports.down = function (knex) { | ||
return knex.schema.renameTable("words", "Words"); | ||
}; |
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,23 @@ | ||
const tableName = "words"; | ||
// alter score table to include timestamps & points | ||
exports.up = async function (knex) { | ||
await knex.schema.alterTable(tableName, function (tbl) { | ||
// add timestamps | ||
tbl.timestamps(false, true); | ||
tbl.string("format", 255).defaultTo("word"); | ||
}); | ||
|
||
await knex.raw(` | ||
CREATE TRIGGER update_timestamp | ||
BEFORE UPDATE | ||
ON ${tableName} | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE update_timestamp();`); | ||
}; | ||
|
||
exports.down = async function (knex) { | ||
await knex.schema.alterTable(tableName, function (tbl) { | ||
tbl.dropTimestamps(); | ||
tbl.dropColumns(["format"]); | ||
}); | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
dist/src/docs/0146db89.b65ab165.js → dist/src/docs/0146db89.517e0dc4.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.