MCPcopy
hub / github.com/drizzle-team/drizzle-orm / addNotNullWithDataNoRollback

Function addNotNullWithDataNoRollback

drizzle-kit/tests/push/pg.test.ts:841–916  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

839 },
840
841 async addNotNullWithDataNoRollback() {
842 const client = new PGlite();
843 const db = drizzle(client);
844
845 const schema1 = {
846 users: pgTable(
847 'User',
848 {
849 id: text('id').primaryKey().notNull(),
850 name: text('name'),
851 username: text('username'),
852 gh_username: text('gh_username'),
853 email: text('email'),
854 emailVerified: timestamp('emailVerified', {
855 precision: 3,
856 mode: 'date',
857 }),
858 image: text('image'),
859 createdAt: timestamp('createdAt', { precision: 3, mode: 'date' })
860 .default(sql`CURRENT_TIMESTAMP`)
861 .notNull(),
862 updatedAt: timestamp('updatedAt', { precision: 3, mode: 'date' })
863 .notNull()
864 .$onUpdate(() => new Date()),
865 },
866 (table) => {
867 return {
868 emailKey: uniqueIndex('User_email_key').on(table.email),
869 };
870 },
871 ),
872 };
873
874 const schema2 = {
875 users: pgTable(
876 'User',
877 {
878 id: text('id').primaryKey().notNull(),
879 name: text('name'),
880 username: text('username'),
881 gh_username: text('gh_username'),
882 email: text('email').notNull(),
883 emailVerified: timestamp('emailVerified', {
884 precision: 3,
885 mode: 'date',
886 }),
887 image: text('image'),
888 createdAt: timestamp('createdAt', { precision: 3, mode: 'date' })
889 .default(sql`CURRENT_TIMESTAMP`)
890 .notNull(),
891 updatedAt: timestamp('updatedAt', { precision: 3, mode: 'date' })
892 .notNull()
893 .$onUpdate(() => new Date()),
894 },
895 (table) => {
896 return {
897 emailKey: uniqueIndex('User_email_key').on(table.email),
898 };

Callers

nothing calls this directly

Calls 11

drizzleFunction · 0.90
pgTableFunction · 0.90
textFunction · 0.90
timestampFunction · 0.90
sqlFunction · 0.90
uniqueIndexFunction · 0.90
diffTestSchemasPushFunction · 0.90
pgSuggestionsFunction · 0.90
onMethod · 0.45
valuesMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected