| 3 | namespace Aptabase.Data.Migrations; |
| 4 | |
| 5 | [Migration(0006)] |
| 6 | public class AddSubscriptions : Migration |
| 7 | { |
| 8 | public override void Up() |
| 9 | { |
| 10 | Create.Table("subscriptions") |
| 11 | .WithColumn("id").AsInt64().NotNullable().PrimaryKey() |
| 12 | .WithNanoIdColumn("owner_id").NotNullable() |
| 13 | .WithColumn("customer_id").AsInt64().NotNullable() |
| 14 | .WithColumn("product_id").AsInt64().NotNullable() |
| 15 | .WithColumn("variant_id").AsInt64().NotNullable() |
| 16 | .WithColumn("status").AsString().NotNullable() |
| 17 | .WithColumn("ends_at").AsDateTimeOffset().Nullable() |
| 18 | .WithTimestamps(); |
| 19 | |
| 20 | Create.Index("idx_subscriptions_owner") |
| 21 | .OnTable("subscriptions") |
| 22 | .OnColumn("owner_id"); |
| 23 | } |
| 24 | |
| 25 | public override void Down() |
| 26 | { |
| 27 | Delete.Index("idx_subscriptions_owner"); |
| 28 | Delete.Table("billing"); |
| 29 | } |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected