diff --git a/packages/db/seed.sql b/packages/db/seed.sql index 5ff5c7c6..bbbce7d2 100644 --- a/packages/db/seed.sql +++ b/packages/db/seed.sql @@ -16,15 +16,6 @@ AS $$ WHERE "listId" = list_id AND index > card_index AND "deletedAt" IS NULL; $$; -CREATE OR REPLACE FUNCTION push_card_index(list_id BIGINT, card_index INT) -RETURNS VOID -LANGUAGE SQL -AS $$ - UPDATE card - SET index = index + 1 - WHERE "listId" = list_id AND index >= card_index AND "deletedAt" IS NULL; -$$; - CREATE OR REPLACE FUNCTION is_workspace_admin(user_id UUID, workspace_id BIGINT) RETURNS BOOLEAN LANGUAGE SQL diff --git a/packages/db/src/repository/card.repo.ts b/packages/db/src/repository/card.repo.ts index 646d83d5..3213146a 100644 --- a/packages/db/src/repository/card.repo.ts +++ b/packages/db/src/repository/card.repo.ts @@ -583,22 +583,6 @@ export const shiftIndex = async ( return data; }; -// Handled in update transaction -export const pushIndex = async ( - db: SupabaseClient, - args: { - listId: number; - cardIndex: number; - }, -) => { - const { data } = await db.rpc("push_card_index", { - list_id: args.listId, - card_index: args.cardIndex, - }); - - return data; -}; - export const softDelete = async ( db: dbClient, args: {