#V2
DEFINE FIELD OVERWRITE updated_at ON org_fleet_vehicle TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS org_fleet_vehicle_org ON org_fleet_vehicle COLUMNS org_id;
DEFINE INDEX IF NOT EXISTS org_fleet_vehicle_unique ON org_fleet_vehicle COLUMNS org_id, fleet_key UNIQUE;
DEFINE TABLE IF NOT EXISTS locker SCHEMALESS;
DEFINE FIELD IF NOT EXISTS uid ON locker TYPE string;
DEFINE FIELD OVERWRITE updated_at ON locker TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS locker_uid ON locker COLUMNS uid UNIQUE;
DEFINE TABLE IF NOT EXISTS locker_item SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON locker_item TYPE string;
DEFINE FIELD IF NOT EXISTS category ON locker_item TYPE string;
DEFINE FIELD IF NOT EXISTS classname ON locker_item TYPE string;
DEFINE FIELD IF NOT EXISTS amount ON locker_item TYPE int;
DEFINE FIELD OVERWRITE updated_at ON locker_item TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS locker_item_owner ON locker_item COLUMNS uid;
DEFINE INDEX IF NOT EXISTS locker_item_unique ON locker_item COLUMNS uid, classname UNIQUE;
DEFINE TABLE IF NOT EXISTS owned_locker SCHEMALESS;
DEFINE FIELD IF NOT EXISTS uid ON owned_locker TYPE string;
DEFINE FIELD OVERWRITE updated_at ON owned_locker TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS owned_locker_uid ON owned_locker COLUMNS uid UNIQUE;
DEFINE TABLE IF NOT EXISTS locker_unlock SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON locker_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS category ON locker_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS classname ON locker_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS source ON locker_unlock TYPE option<string>;
DEFINE FIELD OVERWRITE unlocked_at ON locker_unlock TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS locker_unlock_owner ON locker_unlock COLUMNS uid;
DEFINE INDEX IF NOT EXISTS locker_unlock_unique ON locker_unlock COLUMNS uid, category, classname UNIQUE;
DEFINE TABLE IF NOT EXISTS garage SCHEMALESS;
DEFINE FIELD IF NOT EXISTS uid ON garage TYPE string;
DEFINE FIELD OVERWRITE updated_at ON garage TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS garage_uid ON garage COLUMNS uid UNIQUE;
DEFINE TABLE IF NOT EXISTS garage_vehicle SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON garage_vehicle TYPE string;
DEFINE FIELD IF NOT EXISTS plate ON garage_vehicle TYPE string;
DEFINE FIELD IF NOT EXISTS classname ON garage_vehicle TYPE string;
DEFINE FIELD IF NOT EXISTS fuel ON garage_vehicle TYPE number;
DEFINE FIELD IF NOT EXISTS damage ON garage_vehicle TYPE number;
DEFINE FIELD IF NOT EXISTS hit_points ON garage_vehicle TYPE object;
DEFINE FIELD OVERWRITE updated_at ON garage_vehicle TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS garage_vehicle_owner ON garage_vehicle COLUMNS uid;
DEFINE INDEX IF NOT EXISTS garage_vehicle_unique ON garage_vehicle COLUMNS uid, plate UNIQUE;
DEFINE TABLE IF NOT EXISTS owned_garage SCHEMALESS;
DEFINE FIELD IF NOT EXISTS uid ON owned_garage TYPE string;
DEFINE FIELD OVERWRITE updated_at ON owned_garage TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS owned_garage_uid ON owned_garage COLUMNS uid UNIQUE;
DEFINE TABLE IF NOT EXISTS garage_unlock SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON garage_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS category ON garage_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS classname ON garage_unlock TYPE string;
DEFINE FIELD IF NOT EXISTS source ON garage_unlock TYPE option<string>;
DEFINE FIELD OVERWRITE unlocked_at ON garage_unlock TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS garage_unlock_owner ON garage_unlock COLUMNS uid;
DEFINE INDEX IF NOT EXISTS garage_unlock_unique ON garage_unlock COLUMNS uid, category, classname UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_user SCHEMALESS;
DEFINE FIELD IF NOT EXISTS uid ON phone_user TYPE string;
DEFINE FIELD OVERWRITE updated_at ON phone_user TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_user_uid ON phone_user COLUMNS uid UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_contact SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON phone_contact TYPE string;
DEFINE FIELD IF NOT EXISTS contact_uid ON phone_contact TYPE string;
DEFINE FIELD OVERWRITE created_at ON phone_contact TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_contact_owner ON phone_contact COLUMNS uid;
DEFINE INDEX IF NOT EXISTS phone_contact_unique ON phone_contact COLUMNS uid, contact_uid UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_message SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS message_id ON phone_message TYPE string;
DEFINE FIELD IF NOT EXISTS from_uid ON phone_message TYPE string;
DEFINE FIELD IF NOT EXISTS to_uid ON phone_message TYPE string;
DEFINE FIELD IF NOT EXISTS message ON phone_message TYPE string;
DEFINE FIELD IF NOT EXISTS timestamp ON phone_message TYPE number;
DEFINE FIELD OVERWRITE created_at ON phone_message TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_message_message_id ON phone_message COLUMNS message_id UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_message_index SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON phone_message_index TYPE string;
DEFINE FIELD IF NOT EXISTS message_id ON phone_message_index TYPE string;
DEFINE FIELD IF NOT EXISTS is_read ON phone_message_index TYPE bool;
DEFINE FIELD OVERWRITE updated_at ON phone_message_index TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_message_index_owner ON phone_message_index COLUMNS uid;
DEFINE INDEX IF NOT EXISTS phone_message_index_message ON phone_message_index COLUMNS message_id;
DEFINE INDEX IF NOT EXISTS phone_message_index_unique ON phone_message_index COLUMNS uid, message_id UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_email SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS email_id ON phone_email TYPE string;
DEFINE FIELD IF NOT EXISTS from_uid ON phone_email TYPE string;
DEFINE FIELD IF NOT EXISTS to_uid ON phone_email TYPE string;
DEFINE FIELD IF NOT EXISTS subject ON phone_email TYPE string;
DEFINE FIELD IF NOT EXISTS body ON phone_email TYPE string;
DEFINE FIELD IF NOT EXISTS timestamp ON phone_email TYPE number;
DEFINE FIELD OVERWRITE created_at ON phone_email TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_email_email_id ON phone_email COLUMNS email_id UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_email_index SCHEMAFULL;
DEFINE FIELD IF NOT EXISTS uid ON phone_email_index TYPE string;
DEFINE FIELD IF NOT EXISTS email_id ON phone_email_index TYPE string;
DEFINE FIELD IF NOT EXISTS is_read ON phone_email_index TYPE bool;
DEFINE FIELD OVERWRITE updated_at ON phone_email_index TYPE option<datetime>;
DEFINE INDEX IF NOT EXISTS phone_email_index_owner ON phone_email_index COLUMNS uid;
DEFINE INDEX IF NOT EXISTS phone_email_index_email ON phone_email_index COLUMNS email_id;
DEFINE INDEX IF NOT EXISTS phone_email_index_unique ON phone_email_index COLUMNS uid, email_id UNIQUE;
DEFINE TABLE IF NOT EXISTS phone_sequence SCHEMALESS;
DEFINE FIELD IF NOT EXISTS sequence_id ON phone_sequence TYPE string;
DEFINE FIELD IF NOT EXISTS value ON phone_sequence TYPE int;
DEFINE INDEX IF NOT EXISTS phone_sequence_id ON phone_sequence COLUMNS sequence_id UNIQUE;
