mirror of
https://github.com/plausible/analytics.git
synced 2024-12-27 19:47:26 +03:00
20 lines
628 B
Elixir
20 lines
628 B
Elixir
|
defmodule Plausible.Repo.Migrations.AddEnterprisePlans do
|
||
|
use Ecto.Migration
|
||
|
|
||
|
def change do
|
||
|
create_query = "CREATE TYPE billing_interval AS ENUM ('monthly', 'yearly')"
|
||
|
drop_query = "DROP TYPE billing_interval"
|
||
|
execute(create_query, drop_query)
|
||
|
|
||
|
create table(:enterprise_plans) do
|
||
|
add :user_id, references(:users), null: false, unique: true
|
||
|
add :paddle_plan_id, :string, null: false
|
||
|
add :billing_interval, :billing_interval, null: false
|
||
|
add :monthly_pageview_limit, :integer, null: false
|
||
|
add :hourly_api_request_limit, :integer, null: false
|
||
|
|
||
|
timestamps()
|
||
|
end
|
||
|
end
|
||
|
end
|