using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace kehati.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ms_famili", columns: table => new { MsFamiliId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ms_famili", x => x.MsFamiliId); }); migrationBuilder.CreateTable( name: "ms_group", columns: table => new { MsGroupId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false), Alias = table.Column(type: "text", nullable: false), Status = table.Column(type: "text", nullable: false), CreatedBy = table.Column(type: "integer", nullable: false), UpdatedBy = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ms_group", x => x.MsGroupId); }); migrationBuilder.CreateTable( name: "ms_habitus", columns: table => new { MsHabitusId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ms_habitus", x => x.MsHabitusId); }); migrationBuilder.CreateTable( name: "ms_lokasi", columns: table => new { MsLokasiId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "text", nullable: false), kode = table.Column(type: "integer", nullable: true), status = table.Column(type: "text", nullable: true), image = table.Column(type: "text", nullable: true), slug = table.Column(type: "text", nullable: true), region = table.Column(type: "text", nullable: true), area = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ms_lokasi", x => x.MsLokasiId); }); migrationBuilder.CreateTable( name: "ms_lokasi_tumbuhan", columns: table => new { MsLokasiTumbuhanId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ms_tumbuhan_id = table.Column(type: "integer", nullable: false), ms_lokasi_id = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ms_lokasi_tumbuhan", x => x.MsLokasiTumbuhanId); }); migrationBuilder.CreateTable( name: "ms_menu", columns: table => new { MsMenuId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), parent_id = table.Column(type: "integer", nullable: false), Title = table.Column(type: "text", nullable: false), Module = table.Column(type: "text", nullable: false), Url = table.Column(type: "text", nullable: false), menu_type = table.Column(type: "text", nullable: false), menu_icon = table.Column(type: "text", nullable: false), Ordering = table.Column(type: "text", nullable: false), Status = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ms_menu", x => x.MsMenuId); }); migrationBuilder.CreateTable( name: "ms_tumbuhan", columns: table => new { MsTumbuhanId = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ms_famili_id = table.Column(type: "integer", nullable: false), ms_habitus_id = table.Column(type: "integer", nullable: false), name = table.Column(type: "text", nullable: true), name_ilmiah = table.Column(type: "text", nullable: true), tanaman_khas_jakarta = table.Column(type: "boolean", nullable: false), status_perlindungan = table.Column(type: "text", nullable: true), iucn = table.Column(type: "text", nullable: true), cites = table.Column(type: "text", nullable: true), slug = table.Column(type: "text", nullable: true), image = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ms_tumbuhan", x => x.MsTumbuhanId); }); migrationBuilder.CreateTable( name: "users", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ms_group_id = table.Column(type: "integer", nullable: false), Name = table.Column(type: "text", nullable: false), Username = table.Column(type: "text", nullable: false), Email = table.Column(type: "text", nullable: false), Password = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ms_famili"); migrationBuilder.DropTable( name: "ms_group"); migrationBuilder.DropTable( name: "ms_habitus"); migrationBuilder.DropTable( name: "ms_lokasi"); migrationBuilder.DropTable( name: "ms_lokasi_tumbuhan"); migrationBuilder.DropTable( name: "ms_menu"); migrationBuilder.DropTable( name: "ms_tumbuhan"); migrationBuilder.DropTable( name: "users"); } } }