-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
13 changed files
with
397 additions
and
208 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
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 |
---|---|---|
@@ -1,48 +1,51 @@ | ||
import * as v0001 from "./v0001.js"; | ||
import * as v0002 from "./v0002_add_member_limit.js"; | ||
import * as v0001 from './v0001.js'; | ||
import * as v0002 from './v0002_add_member_limit.js'; | ||
|
||
import * as v0003 from "./v0003_drop_unique_invite_constraint.js"; | ||
import * as v0003 from './v0003_drop_unique_invite_constraint.js'; | ||
|
||
import * as v0004 from "./v0004_push_notifications_and_changelog.js"; | ||
import * as v0004 from './v0004_push_notifications_and_changelog.js'; | ||
|
||
import * as v0005 from "./v0005_push_app_id.js"; | ||
import * as v0005 from './v0005_push_app_id.js'; | ||
|
||
import * as v0006 from "./v0006_foods.js"; | ||
import * as v0006 from './v0006_foods.js'; | ||
|
||
import * as v0007 from "./v0007_changelog_app_ids.js"; | ||
import * as v0007 from './v0007_changelog_app_ids.js'; | ||
|
||
import * as v0008 from "./v0008_more-indexes.js"; | ||
import * as v0008 from './v0008_more-indexes.js'; | ||
|
||
import * as v0009 from "./v0009_food_name_drop_id.js"; | ||
import * as v0009 from './v0009_food_name_drop_id.js'; | ||
|
||
import * as v0010 from "./v0010_add_user_preferences.js"; | ||
import * as v0010 from './v0010_add_user_preferences.js'; | ||
|
||
import * as v0011 from "./v0011_user_tos.js"; | ||
import * as v0011 from './v0011_user_tos.js'; | ||
|
||
import * as v0012 from "./v0012_user_notify_of_new_apps.js"; | ||
import * as v0012 from './v0012_user_notify_of_new_apps.js'; | ||
|
||
import * as v0013 from "./v0013_published_recipes.js"; | ||
import * as v0013 from './v0013_published_recipes.js'; | ||
|
||
import * as v0014 from "./v0014_published_wishlists.js"; | ||
import * as v0014 from './v0014_published_wishlists.js'; | ||
|
||
import * as v0015 from "./v0015_plan_allowed_apps.js"; | ||
import * as v0015 from './v0015_plan_allowed_apps.js'; | ||
|
||
import * as v0016 from "./v0016_wishlist_purchases.js"; | ||
import * as v0016 from './v0016_wishlist_purchases.js'; | ||
|
||
import * as v0017 from './v0017_usage_limits.js'; | ||
export default { | ||
v0001, | ||
v0002, | ||
v0003, | ||
v0004, | ||
v0005, | ||
v0006, | ||
v0007, | ||
v0008, | ||
v0009, | ||
v0010, | ||
v0011, | ||
v0012, | ||
v0013, | ||
v0014, | ||
v0015, | ||
v0016, | ||
v0001, | ||
v0002, | ||
v0003, | ||
v0004, | ||
v0005, | ||
v0006, | ||
v0007, | ||
v0008, | ||
v0009, | ||
v0010, | ||
v0011, | ||
v0012, | ||
v0013, | ||
v0014, | ||
v0015, | ||
v0016, | ||
v0017, | ||
}; |
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,27 @@ | ||
import { Kysely, sql } from 'kysely'; | ||
|
||
// wishlist purchases | ||
|
||
export async function up(db: Kysely<any>) { | ||
// so that the dev server doesn't immediately apply a no-op. | ||
await db.schema | ||
.createTable('UserUsageLimit') | ||
.addColumn('userId', 'text', (b) => | ||
b.notNull().references('User.id').onDelete('cascade'), | ||
) | ||
.addColumn('limitType', 'text', (b) => b.notNull()) | ||
.addColumn('uses', 'integer', (b) => b.notNull().defaultTo(0)) | ||
.addColumn('resetsAt', 'datetime', (b) => b.notNull()) | ||
.addColumn('createdAt', 'datetime', (b) => | ||
b.notNull().defaultTo(sql`CURRENT_TIMESTAMP`), | ||
) | ||
.addColumn('updatedAt', 'datetime', (b) => | ||
b.notNull().defaultTo(sql`CURRENT_TIMESTAMP`), | ||
) | ||
.addPrimaryKeyConstraint('UserUsageLimit_pk', ['userId', 'limitType']) | ||
.execute(); | ||
} | ||
|
||
export async function down(db: Kysely<any>) { | ||
await db.schema.dropTable('UserUsageLimit').execute(); | ||
} |
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
Oops, something went wrong.