ducky/subscriptions

Paddy 2015-10-04 Parent:61c4ce5850da

16:b063bc0a6e84 Go to Latest

ducky/subscriptions/sql/postgres_init.sql

Make api subpackage golint-passing. Add comments to all the exported functions, methods, and variables in the api subpackage, to make golint happy. Also, make the individual endpoints in the api subpackage unexported, as there's no real use case for exporting them. The handlers depend on the placeholders in the endpoint, so we need them to be controlled in unison, which means it's probably a bad idea to declare the route outside of the API package. And the only reason to expose the Handler is so people can declare custom endpoints.

History
1 CREATE TABLE IF NOT EXISTS subscriptions (
2 user_id VARCHAR(36) PRIMARY KEY,
3 stripe_subscription VARCHAR(36) UNIQUE NOT NULL,
4 plan VARCHAR(36) NOT NULL,
5 status VARCHAR(16) NOT NULL,
6 canceling BOOLEAN NOT NULL,
7 created TIMESTAMPTZ NOT NULL,
8 trial_start TIMESTAMPTZ NOT NULL,
9 trial_end TIMESTAMPTZ NOT NULL,
10 period_start TIMESTAMPTZ NOT NULL,
11 period_end TIMESTAMPTZ NOT NULL,
12 canceled_at TIMESTAMPTZ NOT NULL,
13 failed_charge_attempts INTEGER NOT NULL,
14 last_failed_charge TIMESTAMPTZ NOT NULL,
15 last_notified TIMESTAMPTZ NOT NULL
16 );