MCPcopy Create free account
hub / github.com/aptabase/aptabase / AddSubscriptions

Class AddSubscriptions

src/Data/Migrations/0006_AddSubscriptions.cs:5–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace Aptabase.Data.Migrations;
4
5[Migration(0006)]
6public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected