const unsignedBigInt = customType<{
data: number;
// I also tried this ↓ https://orm.drizzle.team/docs/custom-types#examples
// notNull: true;
// default: true;
}>({
dataType() {
return "bigint UNSIGNED";
},
});
export const myTable = mysqlTable("MyTable", {
id: varchar("id", { length: 191 }).primaryKey().notNull(),
//...
// ↓ this was added ↓
usage: unsignedBigInt("usage").default(0).notNull(),
});
const unsignedBigInt = customType<{
data: number;
// I also tried this ↓ https://orm.drizzle.team/docs/custom-types#examples
// notNull: true;
// default: true;
}>({
dataType() {
return "bigint UNSIGNED";
},
});
export const myTable = mysqlTable("MyTable", {
id: varchar("id", { length: 191 }).primaryKey().notNull(),
//...
// ↓ this was added ↓
usage: unsignedBigInt("usage").default(0).notNull(),
});