public override void Up(SchemaAction schema) { schema.ChangeTable("t_movies", t => { t.AddBoolean("is_active").NotNullable().Default(1); }); schema.AddTable("t_categories", t => { t.AddString("name"); }); schema.AddTable("t_movie_categories", t => { t.AddInt32("id_movie").NotNullable().AutoForeignKey("t_movies"); t.AddInt32("id_category").NotNullable().AutoForeignKey("t_categories"); }); }
public override void Up(SchemaAction schema) { schema.AddTable("t_movies", t => { t.AddString("code"); t.AddString("name"); t.AddInt32("duration"); t.AddInt32("enum_format_movie").NotNullable().Default(0); t.AddInt32("enum_type_movie").NotNullable().Default(0); t.AddInt32("stock").NotNullable().Default(0); t.AddDateTime("date").NotNullable().Default("getdate()"); }); }
public override void Up(SchemaAction schema) { schema.AddTable("t_users", t => { t.AddString("name"); t.AddBinary("password").NotNullable().WithSize(48); t.AddInt32("enum_profile_users").NotNullable().Default(0); }); schema.AddTable("t_clients", t => { t.AddString("name"); t.AddString("email"); t.AddString("telephone"); t.AddString("login"); t.AddBinary("password").NotNullable().WithSize(48); t.AddInt32("enum_profile_clients").NotNullable().Default(0); }); schema.AddTable("t_preferences", t => { t.AddInt32("id_client").NotNullable().AutoForeignKey("t_clients"); t.AddInt32("id_categories").NotNullable().AutoForeignKey("t_categories"); t.AddInt32("enum_type_movie").NotNullable().Default(0); }); schema.AddTable("t_reservation", t => { t.AddInt32("id_client").NotNullable().AutoForeignKey("t_clients"); t.AddDateTime("withdraw").NotNullable(); t.AddDateTime("devolution").NotNullable(); }); schema.AddTable("t_itens", t => { t.AddInt32("id_reservation").NotNullable().AutoForeignKey("t_reservations"); t.AddInt32("id_movies").NotNullable().AutoForeignKey("t_movies"); t.AddDouble("value").NotNullable().Default(0.0); t.AddInt32("quantity").NotNullable().Default(0); }); schema.AddTable("t_sales", t => { t.AddInt32("id_reservation").NotNullable().AutoForeignKey("t_reservations"); t.AddInt32("enum_status_sales").NotNullable().Default(0); }); }