From ccc1251f7e960127c893f311a9efdc42ce703d13 Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 14 Jan 2022 09:33:43 -0600 Subject: [PATCH] drop theme from users table --- api/resolvers/user.js | 9 --------- api/typeDefs/user.js | 2 -- fragments/users.js | 1 - .../migrations/20220114153043_drop_theme/migration.sql | 8 ++++++++ prisma/schema.prisma | 1 - 5 files changed, 8 insertions(+), 13 deletions(-) create mode 100644 prisma/migrations/20220114153043_drop_theme/migration.sql diff --git a/api/resolvers/user.js b/api/resolvers/user.js index e8514c99..6051d086 100644 --- a/api/resolvers/user.js +++ b/api/resolvers/user.js @@ -95,15 +95,6 @@ export default { return true }, - setTheme: async (parent, { theme }, { me, models }) => { - if (!me) { - throw new AuthenticationError('you must be logged in') - } - - await models.user.update({ where: { id: me.id }, data: { theme } }) - - return true - }, upsertBio: async (parent, { bio }, { me, models }) => { if (!me) { throw new AuthenticationError('you must be logged in') diff --git a/api/typeDefs/user.js b/api/typeDefs/user.js index d516730e..a461defe 100644 --- a/api/typeDefs/user.js +++ b/api/typeDefs/user.js @@ -17,7 +17,6 @@ export default gql` extend type Mutation { setName(name: String!): Boolean setSettings(tipDefault: Int!): Boolean - setTheme(theme: String!): Boolean upsertBio(bio: String!): User! setWalkthrough(tipPopover: Boolean, upvotePopover: Boolean): Boolean } @@ -37,7 +36,6 @@ export default gql` bio: Item sats: Int! msats: Int! - theme: String! upvotePopover: Boolean! tipPopover: Boolean! } diff --git a/fragments/users.js b/fragments/users.js index ff3213f2..a8664e29 100644 --- a/fragments/users.js +++ b/fragments/users.js @@ -17,7 +17,6 @@ export const ME = gql` id } hasInvites - theme upvotePopover tipPopover } diff --git a/prisma/migrations/20220114153043_drop_theme/migration.sql b/prisma/migrations/20220114153043_drop_theme/migration.sql new file mode 100644 index 00000000..29beff0e --- /dev/null +++ b/prisma/migrations/20220114153043_drop_theme/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - You are about to drop the column `theme` on the `users` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "users" DROP COLUMN "theme"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2c987bc9..06d423ef 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -35,7 +35,6 @@ model User { checkedNotesAt DateTime? tipDefault Int @default(1) pubkey String? @unique - theme String @default("light") upvotePopover Boolean @default(false) tipPopover Boolean @default(false)