-- Test database schema for H2 CREATE TABLE IF NOT EXISTS martial_competition ( id BIGINT PRIMARY KEY, competition_name VARCHAR(255), start_date DATE, end_date DATE, status INT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_athlete ( id BIGINT PRIMARY KEY, order_id BIGINT, competition_id BIGINT, project_id BIGINT, player_name VARCHAR(255), player_no VARCHAR(50), gender INT, age INT, id_card VARCHAR(50), id_card_type VARCHAR(50), birth_date DATE, nation VARCHAR(50), contact_phone VARCHAR(50), organization VARCHAR(255), organization_type VARCHAR(50), team_name VARCHAR(255), category VARCHAR(50), order_num INT, introduction TEXT, attachments TEXT, photo_url VARCHAR(500), registration_status INT, competition_status INT, total_score DECIMAL(10,2), ranking INT, remark TEXT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, status INT DEFAULT 1, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_team ( id BIGINT PRIMARY KEY, competition_id BIGINT, team_name VARCHAR(255), organization VARCHAR(255), contact_person VARCHAR(100), contact_phone VARCHAR(50), total_score DECIMAL(10,2), ranking INT, remark TEXT, member_count INT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, status INT DEFAULT 1, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_team_member ( id BIGINT PRIMARY KEY, team_id BIGINT, athlete_id BIGINT, member_role VARCHAR(50), tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, status INT DEFAULT 1, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_schedule ( id BIGINT PRIMARY KEY, competition_id BIGINT, project_id BIGINT, schedule_date DATE, schedule_time TIME, venue VARCHAR(255), status INT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_schedule_group ( id BIGINT PRIMARY KEY, schedule_id BIGINT, group_name VARCHAR(100), group_order INT, status INT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_schedule_athlete ( id BIGINT PRIMARY KEY, schedule_id BIGINT, group_id BIGINT, athlete_id BIGINT, appearance_order INT, status INT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_project ( id BIGINT PRIMARY KEY, competition_id BIGINT, project_name VARCHAR(255), project_type VARCHAR(50), description TEXT, tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, status INT DEFAULT 1, is_deleted INT DEFAULT 0 ); CREATE TABLE IF NOT EXISTS martial_score ( id BIGINT PRIMARY KEY, competition_id BIGINT, athlete_id BIGINT, project_id BIGINT, judge_id BIGINT, score DECIMAL(10,2), score_type VARCHAR(50), tenant_id VARCHAR(12) DEFAULT '000000', create_user BIGINT, create_dept BIGINT, create_time DATETIME, update_user BIGINT, update_time DATETIME, status INT DEFAULT 1, is_deleted INT DEFAULT 0 );