Custom column type with default not working?

I tried to add a new column with a custom type and a default value.
but for some reason when I tried to db push, it warned me that it didn't have a default value and that it would truncate the tables.
Am I doing something wrong?
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(),
});


· You're about to add not-null usage column without default value, which contains 3 items
Was this page helpful?