()
| 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 | }; |
nothing calls this directly
no test coverage detected