@@ -141,9 +141,67 @@ class Shape1 extends i0.VersionedTable {
141
141
i1.GeneratedColumn <String > _column_9 (String aliasedName) =>
142
142
i1.GeneratedColumn <String >('theme_setting' , aliasedName, true ,
143
143
type: i1.DriftSqlType .string);
144
+
145
+ final class Schema4 extends i0.VersionedSchema {
146
+ Schema4 ({required super .database}) : super (version: 4 );
147
+ @override
148
+ late final List <i1.DatabaseSchemaEntity > entities = [
149
+ globalSettings,
150
+ accounts,
151
+ ];
152
+ late final Shape2 globalSettings = Shape2 (
153
+ source: i0.VersionedTable (
154
+ entityName: 'global_settings' ,
155
+ withoutRowId: false ,
156
+ isStrict: false ,
157
+ tableConstraints: [],
158
+ columns: [
159
+ _column_9,
160
+ _column_10,
161
+ ],
162
+ attachedDatabase: database,
163
+ ),
164
+ alias: null );
165
+ late final Shape0 accounts = Shape0 (
166
+ source: i0.VersionedTable (
167
+ entityName: 'accounts' ,
168
+ withoutRowId: false ,
169
+ isStrict: false ,
170
+ tableConstraints: [
171
+ 'UNIQUE(realm_url, user_id)' ,
172
+ 'UNIQUE(realm_url, email)' ,
173
+ ],
174
+ columns: [
175
+ _column_0,
176
+ _column_1,
177
+ _column_2,
178
+ _column_3,
179
+ _column_4,
180
+ _column_5,
181
+ _column_6,
182
+ _column_7,
183
+ _column_8,
184
+ ],
185
+ attachedDatabase: database,
186
+ ),
187
+ alias: null );
188
+ }
189
+
190
+ class Shape2 extends i0.VersionedTable {
191
+ Shape2 ({required super .source, required super .alias}) : super .aliased ();
192
+ i1.GeneratedColumn <String > get themeSetting =>
193
+ columnsByName['theme_setting' ]! as i1.GeneratedColumn <String >;
194
+ i1.GeneratedColumn <String > get browserPreference =>
195
+ columnsByName['browser_preference' ]! as i1.GeneratedColumn <String >;
196
+ }
197
+
198
+ i1.GeneratedColumn <String > _column_10 (String aliasedName) =>
199
+ i1.GeneratedColumn <String >('browser_preference' , aliasedName, true ,
200
+ type: i1.DriftSqlType .string);
144
201
i0.MigrationStepWithVersion migrationSteps ({
145
202
required Future <void > Function (i1.Migrator m, Schema2 schema) from1To2,
146
203
required Future <void > Function (i1.Migrator m, Schema3 schema) from2To3,
204
+ required Future <void > Function (i1.Migrator m, Schema4 schema) from3To4,
147
205
}) {
148
206
return (currentVersion, database) async {
149
207
switch (currentVersion) {
@@ -157,6 +215,11 @@ i0.MigrationStepWithVersion migrationSteps({
157
215
final migrator = i1.Migrator (database, schema);
158
216
await from2To3 (migrator, schema);
159
217
return 3 ;
218
+ case 3 :
219
+ final schema = Schema4 (database: database);
220
+ final migrator = i1.Migrator (database, schema);
221
+ await from3To4 (migrator, schema);
222
+ return 4 ;
160
223
default :
161
224
throw ArgumentError .value ('Unknown migration from $currentVersion ' );
162
225
}
@@ -166,9 +229,11 @@ i0.MigrationStepWithVersion migrationSteps({
166
229
i1.OnUpgrade stepByStep ({
167
230
required Future <void > Function (i1.Migrator m, Schema2 schema) from1To2,
168
231
required Future <void > Function (i1.Migrator m, Schema3 schema) from2To3,
232
+ required Future <void > Function (i1.Migrator m, Schema4 schema) from3To4,
169
233
}) =>
170
234
i0.VersionedSchema .stepByStepHelper (
171
235
step: migrationSteps (
172
236
from1To2: from1To2,
173
237
from2To3: from2To3,
238
+ from3To4: from3To4,
174
239
));
0 commit comments