You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note**: Tables are automatically exported and available - no need to manually add them to a base schema object.
128
+
130
129
2.**Generate Migration**
131
130
132
131
Run the migration generation command:
@@ -181,7 +180,7 @@ Tables defined by plugins are automatically created when the plugin is loaded an
181
180
182
181
## Development Workflow
183
182
184
-
1. Make schema changes in `src/db/schema.ts`
183
+
1. Make schema changes in `src/db/schema.sqlite.ts`
185
184
2. Generate migrations with `npm run db:generate`
186
185
3. Restart the server to apply migrations
187
186
4. Update application code to use the modified schema
@@ -193,7 +192,7 @@ Tables defined by plugins are automatically created when the plugin is loaded an
193
192
- Include proper foreign key constraints for relational data
194
193
- Add explicit types for all columns
195
194
- Always use migrations for schema changes in development and production
196
-
-**Important**: When adding foreign key relationships, update the dialect-specific schema files (e.g., `src/db/schema.sqlite.ts`) rather than the central `schema.ts` file, as Drizzle Kit uses these files for migration generation
195
+
-**Important**: All schema changes should be made in `src/db/schema.sqlite.ts` as it is the single source of truth for Drizzle Kit migration generation
197
196
- Never manually create migration files - always use `npm run db:generate` to ensure proper migration structure
0 commit comments