feat: seed global billing settings in application_settings
This commit is contained in:
parent
ffb61641bb
commit
7d61d8fb0a
1 changed files with 22 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
defmodule Towerops.Repo.Migrations.SeedBillingSettings do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
execute """
|
||||
INSERT INTO application_settings (id, key, value, value_type, description, inserted_at, updated_at)
|
||||
VALUES
|
||||
(gen_random_uuid(), 'default_free_devices', '10', 'integer',
|
||||
'Number of free devices included in all subscriptions', NOW(), NOW()),
|
||||
(gen_random_uuid(), 'default_price_per_device', '2.00', 'string',
|
||||
'Price per device per month (USD) after free tier', NOW(), NOW())
|
||||
ON CONFLICT (key) DO NOTHING;
|
||||
"""
|
||||
end
|
||||
|
||||
def down do
|
||||
execute """
|
||||
DELETE FROM application_settings
|
||||
WHERE key IN ('default_free_devices', 'default_price_per_device');
|
||||
"""
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue