| 1 | using Microsoft.EntityFrameworkCore.Migrations; |
| 2 | |
| 3 | #nullable disable |
| 4 | |
| 5 | namespace AgentForge.Data.Migrations; |
| 6 | |
| 7 | /// <inheritdoc /> |
| 8 | public partial class AddInstanceAdmins : Migration |
| 9 | { |
| 10 | /// <inheritdoc /> |
| 11 | protected override void Up(MigrationBuilder migrationBuilder) |
| 12 | { |
| 13 | migrationBuilder.CreateTable( |
| 14 | name: "instance_admins", |
| 15 | columns: table => new |
| 16 | { |
| 17 | Id = table.Column<string>(type: "TEXT", nullable: false), |
| 18 | IdentityId = table.Column<string>(type: "TEXT", nullable: false), |
| 19 | CreatedAt = table.Column<string>(type: "TEXT", nullable: false), |
| 20 | }, |
| 21 | constraints: table => |
| 22 | { |
| 23 | table.PrimaryKey("PK_instance_admins", x => x.Id); |
| 24 | table.ForeignKey( |
| 25 | name: "FK_instance_admins_identities_IdentityId", |
| 26 | column: x => x.IdentityId, |
| 27 | principalTable: "identities", |
| 28 | principalColumn: "Id", |
| 29 | onDelete: ReferentialAction.Cascade); |
| 30 | }); |
| 31 | |
| 32 | migrationBuilder.CreateIndex( |
| 33 | name: "IX_instance_admins_IdentityId", |
| 34 | table: "instance_admins", |
| 35 | column: "IdentityId", |
| 36 | unique: true); |
| 37 | } |
| 38 | |
| 39 | /// <inheritdoc /> |
| 40 | protected override void Down(MigrationBuilder migrationBuilder) => |
| 41 | migrationBuilder.DropTable(name: "instance_admins"); |
| 42 | } |
| 43 | |