Add database migration for subscriptions table #586

Open
opened 2026-04-11 03:04:32 -04:00 by pook · 0 comments
Owner

Check if a subscriptions table exists in the database schema. If not, create a migration adding:

sql
CREATE TABLE subscriptions (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) NOT NULL,
stripe_customer_id VARCHAR(255) NOT NULL,
stripe_subscription_id VARCHAR(255) UNIQUE NOT NULL,
status VARCHAR(50) NOT NULL DEFAULT 'active',
plan_tier VARCHAR(50) NOT NULL DEFAULT 'pro',
current_period_start TIMESTAMP,
current_period_end TIMESTAMP,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE INDEX idx_subscriptions_user_id ON subscriptions(user_id);
CREATE INDEX idx_subscriptions_stripe_sub_id ON subscriptions(stripe_subscription_id);

Adapt to project's migration pattern. Prerequisite for subscription webhook handlers.

Acceptance: Migration runs successfully, table exists with correct columns and indexes.


Generated by CEO Planner (priority: 2)

Check if a subscriptions table exists in the database schema. If not, create a migration adding: sql CREATE TABLE subscriptions ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id) NOT NULL, stripe_customer_id VARCHAR(255) NOT NULL, stripe_subscription_id VARCHAR(255) UNIQUE NOT NULL, status VARCHAR(50) NOT NULL DEFAULT 'active', plan_tier VARCHAR(50) NOT NULL DEFAULT 'pro', current_period_start TIMESTAMP, current_period_end TIMESTAMP, created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW() ); CREATE INDEX idx_subscriptions_user_id ON subscriptions(user_id); CREATE INDEX idx_subscriptions_stripe_sub_id ON subscriptions(stripe_subscription_id); Adapt to project's migration pattern. Prerequisite for subscription webhook handlers. Acceptance: Migration runs successfully, table exists with correct columns and indexes. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#586
No description provided.