33using System . Net ;
44using System . Numerics ;
55using Cassandra ;
6+ using EFCore . Cassandra . Samples . Models ;
67using Microsoft . EntityFrameworkCore . Migrations ;
78
89namespace EFCore . Cassandra . Samples . Migrations
@@ -40,7 +41,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
4041 LocalTime = table . Column < LocalTime > ( nullable : true ) ,
4142 Lst = table . Column < IEnumerable < string > > ( nullable : true ) ,
4243 LstInt = table . Column < IEnumerable < int > > ( nullable : true ) ,
43- Dic = table . Column < IDictionary < string , string > > ( nullable : true )
44+ Dic = table . Column < IDictionary < string , string > > ( nullable : true ) ,
45+ Address = table . Column < ApplicantAddress > ( type : "applicant_addr" , nullable : true )
4446 } ,
4547 constraints : table =>
4648 {
@@ -60,6 +62,15 @@ protected override void Up(MigrationBuilder migrationBuilder)
6062 {
6163 table . PrimaryKey ( "PK_cvs" , x => x . Id ) ;
6264 } ) ;
65+
66+ migrationBuilder . CreateUserDefinedType (
67+ name : "applicant_addr" ,
68+ schema : "cv" ,
69+ columns : table => new
70+ {
71+ City = table . Column < string > ( nullable : true ) ,
72+ StreetNumber = table . Column < int > ( nullable : false )
73+ } ) ;
6374 }
6475
6576 protected override void Down ( MigrationBuilder migrationBuilder )
@@ -71,6 +82,10 @@ protected override void Down(MigrationBuilder migrationBuilder)
7182 migrationBuilder . DropTable (
7283 name : "cvs" ,
7384 schema : "cv" ) ;
85+
86+ migrationBuilder . DropUserDefinedType (
87+ name : "applicant_addr" ,
88+ schema : "cv" ) ;
7489 }
7590 }
7691}
0 commit comments