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
This method will provide an interface for adding the type to the database, using the type for table columns, and adding values of this type to rows when seeding data.
##### 3. Use the type as a table column type when creating a table:
166
+
3. Use the type as a table column type when creating a table
167
+
165
168
```rust diff
166
-
// in a migration
169
+
// in a migration:
167
170
168
171
manager::create()
169
172
.table(Tea::Table)
170
173
.if_not_exists()
171
174
.col(Column::new(Tea::Type).custom(TeaType::name())) // use the type for a table column
172
175
// ... more columns
173
176
```
174
-
* see also [Schema Creation Methods - Create Table](https://www.sea-ql.org/SeaORM/docs/migration/writing-migration/#schema-creation-methods)
177
+
> see also [Schema Creation Methods - Create Table](https://www.sea-ql.org/SeaORM/docs/migration/writing-migration/#schema-creation-methods)
178
+
179
+
4. Use the type when populating the database
175
180
176
-
##### 4. Use the type when populating the database:
177
181
```rust
178
182
// in a migration
179
183
@@ -186,7 +190,7 @@ let insert = Query::insert()
186
190
manager.exec_stmt(insert).await?;
187
191
// ...
188
192
```
189
-
* see also [Seeding Data - with sea_query statement](https://www.sea-ql.org/SeaORM/docs/migration/seeding-data/#:~:text=write%20SeaQuery%20statement%20to%20seed%20the%20table)
193
+
>see also [Seeding Data - with sea_query statement](https://www.sea-ql.org/SeaORM/docs/migration/seeding-data/#:~:text=write%20SeaQuery%20statement%20to%20seed%20the%20table)
0 commit comments