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
Copy file name to clipboardExpand all lines: app/controlplane/README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,13 +72,18 @@ make api
72
72
73
73
### Update Application data model
74
74
75
-
We use [ent](https://entgo.io) as database Object Relational Mapping (ORM).
75
+
We use [ent](https://entgo.io) as database Object Relational Mapping (ORM) and [atlas versioned migrations](https://entgo.io/docs/versioned-migrations) to manage the database schema changes.
76
76
77
-
The way a change in the data model is as follows
77
+
The way you can make a change in the data model is
78
78
79
+
**Update the schema**
79
80
- Add a new/update an existing entity via a schema update. Schemas can be found at `internal/data/ent/schema`
80
81
- Generate the code changes associated with that schema change. `make generate`
81
-
- Restarting the control plane will cause the schema change to be automatically migrated.
82
+
- Generate a new versioned migration `make migration_new`. This will create a new migration file at `internal/data/ent/migrate/migrations
83
+
84
+
**Apply the schema change in development DB**
85
+
-`make migration_apply` will apply the migration to the development database
0 commit comments