DROP TRIGGER IF EXISTS trg_cron_jobs_updated_at ON cron_jobs;
DROP TRIGGER IF EXISTS trg_dns_records_updated_at ON dns_records;
DROP TRIGGER IF EXISTS trg_dns_zones_updated_at ON dns_zones;
DROP TRIGGER IF EXISTS trg_mail_accounts_updated_at ON mail_accounts;
DROP TRIGGER IF EXISTS trg_ssl_certificates_updated_at ON ssl_certificates;
DROP TRIGGER IF EXISTS trg_ftp_accounts_updated_at ON ftp_accounts;
DROP TRIGGER IF EXISTS trg_sites_updated_at ON sites;
DROP TRIGGER IF EXISTS trg_servers_updated_at ON servers;
DROP TRIGGER IF EXISTS trg_users_updated_at ON users;

DROP FUNCTION IF EXISTS set_updated_at();

DROP TABLE IF EXISTS audit_logs;
DROP TABLE IF EXISTS jobs;
DROP TABLE IF EXISTS backups;
DROP TABLE IF EXISTS cron_jobs;
DROP TABLE IF EXISTS dns_records;
DROP TABLE IF EXISTS dns_zones;
DROP TABLE IF EXISTS mail_accounts;
DROP TABLE IF EXISTS mail_domains;
DROP TABLE IF EXISTS ssl_certificates;
DROP TABLE IF EXISTS ftp_accounts;
DROP TABLE IF EXISTS database_users;
DROP TABLE IF EXISTS databases;
DROP TABLE IF EXISTS domains;
DROP TABLE IF EXISTS sites;
DROP TABLE IF EXISTS server_access;
DROP TABLE IF EXISTS servers;
DROP TABLE IF EXISTS api_keys;
DROP TABLE IF EXISTS sessions;
DROP TABLE IF EXISTS users;

DROP TYPE IF EXISTS dns_record_type;
DROP TYPE IF EXISTS job_status;
DROP TYPE IF EXISTS backup_status;
DROP TYPE IF EXISTS backup_type;
DROP TYPE IF EXISTS db_engine;
DROP TYPE IF EXISTS ssl_status;
DROP TYPE IF EXISTS ssl_type;
DROP TYPE IF EXISTS site_status;
DROP TYPE IF EXISTS server_status;
DROP TYPE IF EXISTS user_role;
DROP TYPE IF EXISTS user_status;

DROP EXTENSION IF EXISTS citext;
DROP EXTENSION IF EXISTS pgcrypto;
