mirror of
				https://github.com/Wan-Video/Wan2.1.git
				synced 2025-11-03 22:04:21 +00:00 
			
		
		
		
	
				- Add root package.json and turbo.json - Add Next.js config files - Add FastAPI environment example - Add PWA manifest - Add ESLint and Prettier config 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>  | 
			||
|---|---|---|
| .. | ||
| migrations | ||
| package.json | ||
| README.md | ||
Database Package
This package contains database schema and migrations for the Wan2.1 PWA.
Setup
- Go to your Supabase dashboard
 - Navigate to SQL Editor
 - Create a new query
 - Copy the contents of 
migrations/001_initial_schema.sql - Run the query
 
Schema
Tables
users
- Stores user profile data
 - Extends Supabase auth.users
 - Tracks credits and subscription tier
 
generations
- Stores video generation requests and results
 - Links to users and tracks status
 - Stores prompts, settings, and output URLs
 
credit_transactions
- Tracks all credit additions and deductions
 - Provides audit trail for user credits
 
Storage
images bucket
- Stores uploaded images for Image-to-Video generation
 - Publicly accessible
 - Organized by user ID
 
Row Level Security (RLS)
All tables have RLS enabled to ensure users can only access their own data:
- Users can read/update their own profile
 - Users can view/create their own generations
 - Users can view their own transactions
 
Migrations
Migrations should be run in order:
001_initial_schema.sql- Core schema002_seed_data.sql- Optional seed data
Indexes
Indexes are created on:
generations.user_idgenerations.created_atcredit_transactions.user_idcredit_transactions.created_at
These optimize common queries for user data and history.