{ "version": "6", "dialect": "sqlite", "id": "42e92bf2-2b1c-441b-97f3-bc487a674e4d", "prevId": "00000000-0000-0000-0000-000000000000", "tables": { "attendance": { "name": "attendance", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "check_in_time": { "name": "check_in_time", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "check_out_time": { "name": "check_out_time", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "type": { "name": "type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'gym'" }, "notes": { "name": "notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "attendance_user_id_idx": { "name": "attendance_user_id_idx", "columns": [ "user_id" ], "isUnique": false }, "attendance_check_in_time_idx": { "name": "attendance_check_in_time_idx", "columns": [ "check_in_time" ], "isUnique": false }, "attendance_user_check_in_idx": { "name": "attendance_user_check_in_idx", "columns": [ "user_id", "check_in_time" ], "isUnique": false } }, "foreignKeys": { "attendance_user_id_users_id_fk": { "name": "attendance_user_id_users_id_fk", "tableFrom": "attendance", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "clients": { "name": "clients", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "membership_type": { "name": "membership_type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'basic'" }, "membership_status": { "name": "membership_status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "join_date": { "name": "join_date", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "last_visit": { "name": "last_visit", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "emergency_contact_name": { "name": "emergency_contact_name", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "emergency_contact_phone": { "name": "emergency_contact_phone", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "emergency_contact_relationship": { "name": "emergency_contact_relationship", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "clients_user_id_unique": { "name": "clients_user_id_unique", "columns": [ "user_id" ], "isUnique": true }, "clients_user_id_idx": { "name": "clients_user_id_idx", "columns": [ "user_id" ], "isUnique": false }, "clients_membership_status_idx": { "name": "clients_membership_status_idx", "columns": [ "membership_status" ], "isUnique": false } }, "foreignKeys": { "clients_user_id_users_id_fk": { "name": "clients_user_id_users_id_fk", "tableFrom": "clients", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "fitness_goals": { "name": "fitness_goals", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "fitness_profile_id": { "name": "fitness_profile_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "goal_type": { "name": "goal_type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "target_value": { "name": "target_value", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "current_value": { "name": "current_value", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "unit": { "name": "unit", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "start_date": { "name": "start_date", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "target_date": { "name": "target_date", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "completed_date": { "name": "completed_date", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "progress": { "name": "progress", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false, "default": 0 }, "priority": { "name": "priority", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false, "default": "'medium'" }, "notes": { "name": "notes", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "fitness_goals_user_id_idx": { "name": "fitness_goals_user_id_idx", "columns": [ "user_id" ], "isUnique": false }, "fitness_goals_status_idx": { "name": "fitness_goals_status_idx", "columns": [ "status" ], "isUnique": false }, "fitness_goals_user_status_idx": { "name": "fitness_goals_user_status_idx", "columns": [ "user_id", "status" ], "isUnique": false } }, "foreignKeys": { "fitness_goals_user_id_users_id_fk": { "name": "fitness_goals_user_id_users_id_fk", "tableFrom": "fitness_goals", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "fitness_goals_fitness_profile_id_fitness_profiles_id_fk": { "name": "fitness_goals_fitness_profile_id_fitness_profiles_id_fk", "tableFrom": "fitness_goals", "tableTo": "fitness_profiles", "columnsFrom": [ "fitness_profile_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "fitness_profiles": { "name": "fitness_profiles", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "height": { "name": "height", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "weight": { "name": "weight", "type": "real", "primaryKey": false, "notNull": false, "autoincrement": false }, "age": { "name": "age", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "gender": { "name": "gender", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "fitness_goals": { "name": "fitness_goals", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "activity_level": { "name": "activity_level", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "medical_conditions": { "name": "medical_conditions", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "allergies": { "name": "allergies", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "injuries": { "name": "injuries", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "fitness_profiles_user_id_unique": { "name": "fitness_profiles_user_id_unique", "columns": [ "user_id" ], "isUnique": true }, "fitness_profiles_user_id_idx": { "name": "fitness_profiles_user_id_idx", "columns": [ "user_id" ], "isUnique": false } }, "foreignKeys": { "fitness_profiles_user_id_users_id_fk": { "name": "fitness_profiles_user_id_users_id_fk", "tableFrom": "fitness_profiles", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "gyms": { "name": "gyms", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "location": { "name": "location", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "admin_user_id": { "name": "admin_user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "gyms_admin_user_id_idx": { "name": "gyms_admin_user_id_idx", "columns": [ "admin_user_id" ], "isUnique": false }, "gyms_status_idx": { "name": "gyms_status_idx", "columns": [ "status" ], "isUnique": false } }, "foreignKeys": { "gyms_admin_user_id_users_id_fk": { "name": "gyms_admin_user_id_users_id_fk", "tableFrom": "gyms", "tableTo": "users", "columnsFrom": [ "admin_user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "notifications": { "name": "notifications", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "message": { "name": "message", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "type": { "name": "type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "read": { "name": "read", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "notifications_user_id_idx": { "name": "notifications_user_id_idx", "columns": [ "user_id" ], "isUnique": false }, "notifications_read_idx": { "name": "notifications_read_idx", "columns": [ "read" ], "isUnique": false }, "notifications_user_read_idx": { "name": "notifications_user_read_idx", "columns": [ "user_id", "read" ], "isUnique": false } }, "foreignKeys": { "notifications_user_id_users_id_fk": { "name": "notifications_user_id_users_id_fk", "tableFrom": "notifications", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "payments": { "name": "payments", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "client_id": { "name": "client_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "amount": { "name": "amount", "type": "real", "primaryKey": false, "notNull": true, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'USD'" }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "payment_method": { "name": "payment_method", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "due_date": { "name": "due_date", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "paid_at": { "name": "paid_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "payments_client_id_idx": { "name": "payments_client_id_idx", "columns": [ "client_id" ], "isUnique": false }, "payments_status_idx": { "name": "payments_status_idx", "columns": [ "status" ], "isUnique": false }, "payments_due_date_idx": { "name": "payments_due_date_idx", "columns": [ "due_date" ], "isUnique": false } }, "foreignKeys": { "payments_client_id_clients_id_fk": { "name": "payments_client_id_clients_id_fk", "tableFrom": "payments", "tableTo": "clients", "columnsFrom": [ "client_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "recommendations": { "name": "recommendations", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "fitness_profile_id": { "name": "fitness_profile_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "recommendation_text": { "name": "recommendation_text", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "activity_plan": { "name": "activity_plan", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "diet_plan": { "name": "diet_plan", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "generated_at": { "name": "generated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "approved_at": { "name": "approved_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "approved_by": { "name": "approved_by", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "recommendations_user_id_idx": { "name": "recommendations_user_id_idx", "columns": [ "user_id" ], "isUnique": false }, "recommendations_status_idx": { "name": "recommendations_status_idx", "columns": [ "status" ], "isUnique": false }, "recommendations_fitness_profile_id_idx": { "name": "recommendations_fitness_profile_id_idx", "columns": [ "fitness_profile_id" ], "isUnique": false } }, "foreignKeys": { "recommendations_user_id_users_id_fk": { "name": "recommendations_user_id_users_id_fk", "tableFrom": "recommendations", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "recommendations_fitness_profile_id_fitness_profiles_id_fk": { "name": "recommendations_fitness_profile_id_fitness_profiles_id_fk", "tableFrom": "recommendations", "tableTo": "fitness_profiles", "columnsFrom": [ "fitness_profile_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "trainer_clients": { "name": "trainer_clients", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "trainer_user_id": { "name": "trainer_user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "client_user_id": { "name": "client_user_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "gym_id": { "name": "gym_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "trainer_clients_trainer_id_idx": { "name": "trainer_clients_trainer_id_idx", "columns": [ "trainer_user_id" ], "isUnique": false }, "trainer_clients_client_id_idx": { "name": "trainer_clients_client_id_idx", "columns": [ "client_user_id" ], "isUnique": false }, "trainer_clients_gym_id_idx": { "name": "trainer_clients_gym_id_idx", "columns": [ "gym_id" ], "isUnique": false }, "trainer_client_unique": { "name": "trainer_client_unique", "columns": [ "trainer_user_id", "client_user_id" ], "isUnique": true } }, "foreignKeys": { "trainer_clients_trainer_user_id_users_id_fk": { "name": "trainer_clients_trainer_user_id_users_id_fk", "tableFrom": "trainer_clients", "tableTo": "users", "columnsFrom": [ "trainer_user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "trainer_clients_client_user_id_users_id_fk": { "name": "trainer_clients_client_user_id_users_id_fk", "tableFrom": "trainer_clients", "tableTo": "users", "columnsFrom": [ "client_user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "trainer_clients_gym_id_gyms_id_fk": { "name": "trainer_clients_gym_id_gyms_id_fk", "tableFrom": "trainer_clients", "tableTo": "gyms", "columnsFrom": [ "gym_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "users": { "name": "users", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "first_name": { "name": "first_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "last_name": { "name": "last_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'client'" }, "phone": { "name": "phone", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "gym_id": { "name": "gym_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "users_email_unique": { "name": "users_email_unique", "columns": [ "email" ], "isUnique": true }, "users_email_idx": { "name": "users_email_idx", "columns": [ "email" ], "isUnique": false }, "users_gym_id_idx": { "name": "users_gym_id_idx", "columns": [ "gym_id" ], "isUnique": false }, "users_role_idx": { "name": "users_role_idx", "columns": [ "role" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} } }, "views": {}, "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "indexes": {} } }