ducky/subscriptions
2015-06-22
Parent:61c4ce5850da
ducky/subscriptions/sql/postgres_init.sql
Add an API and subscriptionsd . Create a barebones implementation of the API, including only methods to create a Subscription and retrieve the Subscription associated with a user. Also create a subscriptiond service that will bootstrap the service and stores, and get everything stood up.
| paddy@1 | 1 CREATE TABLE IF NOT EXISTS subscriptions ( |
| paddy@1 | 2 user_id VARCHAR(36) PRIMARY KEY, |
| paddy@2 | 3 stripe_subscription VARCHAR(36) UNIQUE NOT NULL, |
| paddy@2 | 4 plan VARCHAR(36) NOT NULL, |
| paddy@2 | 5 status VARCHAR(16) NOT NULL, |
| paddy@2 | 6 canceling BOOLEAN NOT NULL, |
| paddy@1 | 7 created TIMESTAMPTZ NOT NULL, |
| paddy@2 | 8 trial_start TIMESTAMPTZ NOT NULL, |
| paddy@2 | 9 trial_end TIMESTAMPTZ NOT NULL, |
| paddy@2 | 10 period_start TIMESTAMPTZ NOT NULL, |
| paddy@2 | 11 period_end TIMESTAMPTZ NOT NULL, |
| paddy@2 | 12 canceled_at TIMESTAMPTZ NOT NULL, |
| paddy@2 | 13 failed_charge_attempts INTEGER NOT NULL, |
| paddy@2 | 14 last_failed_charge TIMESTAMPTZ NOT NULL, |
| paddy@2 | 15 last_notified TIMESTAMPTZ NOT NULL |
| paddy@1 | 16 ); |