Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
chore: remove constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Mar 23, 2024
1 parent 835d2cb commit 2b7023f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/kanao-schema/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "f7401341-0beb-4c78-a112-bf04a92a185f",
"id": "b8909ecb-c2db-4001-96d5-033f1840e500",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "5",
"dialect": "pg",
Expand Down
4 changes: 2 additions & 2 deletions packages/kanao-schema/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1709350996171,
"tag": "0000_grey_mach_iv",
"when": 1711192755584,
"tag": "0000_skinny_shiva",
"breakpoints": true
}
]
Expand Down
6 changes: 2 additions & 4 deletions packages/kanao-schema/src/Schema/channel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pgTable, text, integer, boolean, primaryKey } from "drizzle-orm/pg-core";
import { pgTable, text, integer, boolean } from "drizzle-orm/pg-core";

export const channels = pgTable("channels", {
id: text("id").primaryKey(),
Expand Down Expand Up @@ -31,6 +31,4 @@ export const channelsOverwrite = pgTable("channels_overwrite", {
type: integer("type"),
allow: text("allow"),
deny: text("deny")
}, table => ({
pkWithCustomName: primaryKey({ name: "channels_overwrite_user_or_role_channel_id", columns: [table.userOrRole, table.channelId] })
}));
});
8 changes: 3 additions & 5 deletions packages/kanao-schema/src/Schema/member.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { pgTable, integer, text, boolean, primaryKey } from "drizzle-orm/pg-core";
import { pgTable, integer, text, boolean } from "drizzle-orm/pg-core";

export const members = pgTable("members", {
id: text("id"),
id: text("id").primaryKey(),
guildId: text("guild_id"),

nick: text("nick"),
Expand All @@ -13,6 +13,4 @@ export const members = pgTable("members", {
mute: boolean("mute"),
pending: boolean("pending"),
communicationDisabledUntil: text("communication_disabled_until")
}, table => ({
pkWithCustomName: primaryKey({ name: "members_id_guild_id", columns: [table.id, table.guildId] })
}));
});
13 changes: 2 additions & 11 deletions packages/kanao-schema/src/Schema/roles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { relations } from "drizzle-orm";
import { boolean, integer, pgTable, primaryKey, text } from "drizzle-orm/pg-core";
import { boolean, integer, pgTable, text } from "drizzle-orm/pg-core";

export const roles = pgTable("roles", {
id: text("id").primaryKey(),
Expand All @@ -15,13 +14,5 @@ export const memberRoles = pgTable("member_roles", {
memberId: text("member_id").notNull(),
roleId: text("role_id").notNull(),
guildId: text("guild_id").notNull()
}, table => ({
pkWithCustomName: primaryKey({ name: "voice_states_member_id_role_id", columns: [table.memberId, table.roleId] })
}));
});

export const memberRolesRelations = relations(memberRoles, ({ one }) => ({
role: one(roles, {
fields: [memberRoles.roleId],
references: [roles.id]
})
}));
6 changes: 2 additions & 4 deletions packages/kanao-schema/src/Schema/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pgTable, text, boolean, primaryKey } from "drizzle-orm/pg-core";
import { pgTable, text, boolean } from "drizzle-orm/pg-core";

export const voiceStates = pgTable("voice_states", {
memberId: text("member_id").notNull(),
Expand All @@ -14,6 +14,4 @@ export const voiceStates = pgTable("voice_states", {
selfVideo: boolean("self_video"),
suppress: boolean("suppress"),
requestToSpeakTimestamp: text("request_to_speak_timestamp")
}, table => ({
pkWithCustomName: primaryKey({ name: "voice_states_member_id_guild_id", columns: [table.memberId, table.guildId] })
}));
});

0 comments on commit 2b7023f

Please sign in to comment.