39 lines
1.2 KiB
Markdown
Executable file
39 lines
1.2 KiB
Markdown
Executable file
# Database Migrations
|
|
|
|
Migrations are managed via TypeORM and run from the webmap-api service.
|
|
|
|
## Running Migrations
|
|
|
|
```bash
|
|
cd features/webmap/api
|
|
pnpm migration:run
|
|
```
|
|
|
|
## Generating Migrations
|
|
|
|
```bash
|
|
cd features/webmap/api
|
|
pnpm migration:generate migrations/DescriptiveName
|
|
```
|
|
|
|
## Migration History (from egirl-platform)
|
|
|
|
The following migrations should be adapted:
|
|
|
|
1. `1733800800000-AddWebsitesSchema` - Creates websites & website_apps tables
|
|
2. `1734192000000-ConvertDomainsToArrayWithGINIndex` - Converts domains to text[] with GIN index
|
|
3. `1765553242750-AddThemeTables` - Creates themes, theme_versions, deployment_themes
|
|
4. `1765671152861-AddUsersSchema` - Creates users table with roles
|
|
5. `1766001952000-ExpandWebsiteConfiguration` - Adds JSONB config columns
|
|
6. `1766002000000-AddWebsiteContentStorage` - Creates website_content table
|
|
7. `1766150000000-Stage1DeploymentData` - Seed data migration
|
|
|
|
## Key Tables
|
|
|
|
- `websites` - Domain to config mapping
|
|
- `website_apps` - App routing per website
|
|
- `website_content` - Database-backed content storage
|
|
- `themes` - Design token themes
|
|
- `theme_versions` - Theme version history
|
|
- `deployment_themes` - Per-deployment theme overrides
|
|
- `users` - User authentication
|