-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from aXenDeveloper/database/indexes
feat(database): Add indexes to database
- Loading branch information
Showing
13 changed files
with
511 additions
and
284 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
import { | ||
boolean, | ||
index, | ||
integer, | ||
pgTable, | ||
serial, | ||
varchar | ||
} from "drizzle-orm/pg-core"; | ||
|
||
export const core_languages = pgTable("core_languages", { | ||
id: serial("id").primaryKey(), | ||
code: varchar("code", { length: 32 }).notNull().unique(), | ||
name: varchar("name", { length: 255 }).notNull(), | ||
timezone: varchar("timezone", { length: 255 }).notNull().default("UTC"), | ||
protected: boolean("protected").notNull().default(false), | ||
default: boolean("default").notNull().default(false), | ||
enabled: boolean("enabled").notNull().default(true), | ||
created: integer("created").notNull() | ||
}); | ||
export const core_languages = pgTable( | ||
"core_languages", | ||
{ | ||
id: serial("id").primaryKey(), | ||
code: varchar("code", { length: 32 }).notNull().unique(), | ||
name: varchar("name", { length: 255 }).notNull(), | ||
timezone: varchar("timezone", { length: 255 }).notNull().default("UTC"), | ||
protected: boolean("protected").notNull().default(false), | ||
default: boolean("default").notNull().default(false), | ||
enabled: boolean("enabled").notNull().default(true), | ||
created: integer("created").notNull() | ||
}, | ||
table => ({ | ||
code_idx: index("core_languages_code_idx").on(table.code), | ||
name_idx: index("core_languages_name_idx").on(table.name) | ||
}) | ||
); |
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.