Skip to content

Commit

Permalink
init collection route files, remove favourites
Browse files Browse the repository at this point in the history
  • Loading branch information
dromzeh committed Mar 17, 2024
1 parent ef1924b commit 2815656
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 170 deletions.
44 changes: 0 additions & 44 deletions src/scripts/seed/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
gameAssetCategory,
userCollection,
userCollectionAsset,
userFavourite,
userFavouriteAsset,
userFollowing,
requestFormUpvotes,
requestForm,
Expand Down Expand Up @@ -513,48 +511,6 @@ async function main() {
`[SEED] [userCollectionAsset] inserted ${newUserCollectionAssets.length} rows\n`
)

// only one user favourite per user
console.log("[SEED] [userFavourite] Seeding user favourites...")
const newUserFavourites = await db
.insert(userFavourite)
.values([
{
userId: newUsers[0].id,
},
{
userId: newUsers[1].id,
isPublic: false,
},
])
.returning()
console.log(
`[SEED] [userFavourite] inserted ${newUserFavourites.length} rows\n`
)

console.log(
"[SEED] [userFavouriteAsset] Linking user favourites to assets..."
)
const newUserFavouriteAssets = await db
.insert(userFavouriteAsset)
.values([
{
userFavouriteId: newUserFavourites[0].id,
assetId: newAssets[0].id,
},
{
userFavouriteId: newUserFavourites[0].id,
assetId: newAssets[1].id,
},
{
userFavouriteId: newUserFavourites[1].id,
assetId: newAssets[2].id,
},
])
.returning()
console.log(
`[SEED] [userFavouriteAsset] inserted ${newUserFavouriteAssets.length} rows\n`
)

console.log("[SEED] Seeded database successfully")
process.exit(0)
}
Expand Down
1 change: 0 additions & 1 deletion src/v2/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export * from "./schema/user/user"
export * from "./schema/user/user-attributes"
export * from "./schema/collections/user-collections"
export * from "./schema/user/user-connections"
export * from "./schema/user/user-favourites"
export * from "./schema/user/user-following"
export * from "./schema/user/user-blocked"

Expand Down
123 changes: 0 additions & 123 deletions src/v2/db/schema/user/user-favourites.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/v2/db/schema/user/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { createInsertSchema, createSelectSchema } from "drizzle-zod"
import { generateID } from "@/v2/lib/oslo"
import { userFollowing } from "./user-following"
import { asset } from "../asset/asset"
import { userFavourite } from "./user-favourites"
import { socialsConnection } from "./user-connections"
import { userCollection } from "../collections/user-collections"
import { passwordResetToken } from "./user-attributes"
Expand Down Expand Up @@ -207,7 +206,6 @@ export const usersRelations = relations(authUser, ({ one, many }) => ({
userSession: many(userSession),
asset: many(asset),
assetExternalFile: many(assetExternalFile),
userFavourite: one(userFavourite),
userCollectionLikes: many(userCollectionLikes),
assetLikes: many(assetLikes),
assetComments: many(assetComments),
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit 2815656

Please sign in to comment.