实在是太多了 光SQL加起来就几百行 整个前端HTML大131KB 累死了啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
可以共享、可以push的免费邮箱,更可使用自定义域名,完美契合您的各项需求。
用supabase的SQL总结一下就是:
CREATE TABLE public.admins ( user_id uuid NOT NULL, role character varying DEFAULT 'admin'::character varying, created_at timestamp with time zone DEFAULT now(), CONSTRAINT admins_pkey PRIMARY KEY (user_id), CONSTRAINT admins_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ); CREATE TABLE public.audit_logs ( id integer NOT NULL DEFAULT nextval('audit_logs_id_seq'::regclass), user_id uuid, action character varying, domain character varying, details jsonb, created_at timestamp without time zone DEFAULT now(), CONSTRAINT audit_logs_pkey PRIMARY KEY (id), CONSTRAINT audit_logs_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ); CREATE TABLE public.domain_listings ( id integer NOT NULL DEFAULT nextval('domain_listings_id_seq'::regclass), domain_id integer, seller_id uuid, price integer NOT NULL, description text, status character varying DEFAULT 'active'::character varying, created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), CONSTRAINT domain_listings_pkey PRIMARY KEY (id), CONSTRAINT domain_listings_domain_id_fkey FOREIGN KEY (domain_id) REFERENCES public.user_domains(id), CONSTRAINT domain_listings_seller_id_fkey FOREIGN KEY (seller_id) REFERENCES auth.users(id) ); CREATE TABLE public.forum_posts ( id integer NOT NULL DEFAULT nextval('forum_posts_id_seq'::regclass), author_id uuid, author_name character varying NOT NULL, content text NOT NULL, replies jsonb DEFAULT '[]'::jsonb, created_at timestamp with time zone DEFAULT now(), CONSTRAINT forum_posts_pkey PRIMARY KEY (id), CONSTRAINT forum_posts_author_id_fkey FOREIGN KEY (author_id) REFERENCES auth.users(id) ); CREATE TABLE public.friendships ( id integer NOT NULL DEFAULT nextval('friendships_id_seq'::regclass), user_id uuid NOT NULL, friend_id uuid NOT NULL, status character varying DEFAULT 'pending'::character varying, created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), CONSTRAINT friendships_pkey PRIMARY KEY (id), CONSTRAINT friendships_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id), CONSTRAINT friendships_friend_id_fkey FOREIGN KEY (friend_id) REFERENCES auth.users(id) ); CREATE TABLE public.ft_checkins ( user_id uuid NOT NULL, last_checkin date, created_at timestamp with time zone DEFAULT now(), CONSTRAINT ft_checkins_pkey PRIMARY KEY (user_id), CONSTRAINT ft_checkins_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ); CREATE TABLE public.ft_transactions ( id integer NOT NULL DEFAULT nextval('ft_transactions_id_seq'::regclass), user_id uuid, amount integer NOT NULL, type character varying NOT NULL, counterparty_id uuid, counterparty_name character varying, note text, created_at timestamp with time zone DEFAULT now(), CONSTRAINT ft_transactions_pkey PRIMARY KEY (id), CONSTRAINT ft_transactions_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id), CONSTRAINT ft_transactions_counterparty_id_fkey FOREIGN KEY (counterparty_id) REFERENCES auth.users(id) ); CREATE TABLE public.ft_withdrawals ( id integer NOT NULL DEFAULT nextval('ft_withdrawals_id_seq'::regclass), user_id uuid, ft_amount integer NOT NULL, pol_amount numeric NOT NULL, wallet_address character varying NOT NULL, status character varying DEFAULT 'pending'::character varying, tx_hash character varying, admin_note text, created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), CONSTRAINT ft_withdrawals_pkey PRIMARY KEY (id), CONSTRAINT ft_withdrawals_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ); CREATE TABLE public.private_messages ( id integer NOT NULL DEFAULT nextval('private_messages_id_seq'::regclass), from_user_id uuid NOT NULL, to_user_id uuid NOT NULL, subject character varying, content text NOT NULL, is_read boolean DEFAULT false, is_deleted_by_sender boolean DEFAULT false, is_deleted_by_receiver boolean DEFAULT false, created_at timestamp with time zone DEFAULT now(), read_at timestamp with time zone, CONSTRAINT private_messages_pkey PRIMARY KEY (id), CONSTRAINT private_messages_from_user_id_fkey FOREIGN KEY (from_user_id) REFERENCES auth.users(id), CONSTRAINT private_messages_to_user_id_fkey FOREIGN KEY (to_user_id) REFERENCES auth.users(id) ); CREATE TABLE public.profiles ( id uuid NOT NULL, email text NOT NULL UNIQUE, username text NOT NULL UNIQUE, avatar_url text, provider character varying NOT NULL, provider_id character varying NOT NULL, created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), wallet_address text, ens_name text, nickname character varying, bio text, ft_balance integer DEFAULT 20, frozen_ft integer DEFAULT 0, ft_frozen integer DEFAULT 0, CONSTRAINT profiles_pkey PRIMARY KEY (id), CONSTRAINT profiles_id_fkey FOREIGN KEY (id) REFERENCES auth.users(id) ); CREATE TABLE public.records ( id integer NOT NULL DEFAULT nextval('records_id_seq'::regclass), user_id uuid, zone_id integer, subdomain character varying NOT NULL, type character varying NOT NULL, value text NOT NULL, ttl integer DEFAULT 600, dns_record_id integer, status character varying DEFAULT 'active'::character varying, created_at timestamp without time zone DEFAULT now(), CONSTRAINT records_pkey PRIMARY KEY (id), CONSTRAINT records_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id), CONSTRAINT records_zone_id_fkey FOREIGN KEY (zone_id) REFERENCES public.zones(id) ); CREATE TABLE public.site_reports ( id integer NOT NULL DEFAULT nextval('site_reports_id_seq'::regclass), site_id integer, reporter_id uuid, reason text, created_at timestamp with time zone DEFAULT now(), CONSTRAINT site_reports_pkey PRIMARY KEY (id), CONSTRAINT site_reports_site_id_fkey FOREIGN KEY (site_id) REFERENCES public.site_showcase(id), CONSTRAINT site_reports_reporter_id_fkey FOREIGN KEY (reporter_id) REFERENCES auth.users(id) ); CREATE TABLE public.site_showcase ( id integer NOT NULL DEFAULT nextval('site_showcase_id_seq'::regclass), user_id uuid, domain character varying NOT NULL UNIQUE, site_name character varying NOT NULL, description text, status character varying DEFAULT 'active'::character varying, report_count integer DEFAULT 0, created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), CONSTRAINT site_showcase_pkey PRIMARY KEY (id), CONSTRAINT site_showcase_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id), CONSTRAINT fk_site_showcase_user_id FOREIGN KEY (user_id) REFERENCES public.profiles(id) ); CREATE TABLE public.user_domains ( id integer NOT NULL DEFAULT nextval('user_domains_id_seq'::regclass), user_id uuid, zone_domain character varying NOT NULL, subdomain character varying NOT NULL CHECK (subdomain::text <> ''::text AND subdomain IS NOT NULL), created_at timestamp with time zone DEFAULT now(), mode character varying DEFAULT 'furrynic'::character varying, ns_servers jsonb DEFAULT '[]'::jsonb, CONSTRAINT user_domains_pkey PRIMARY KEY (id), CONSTRAINT user_domains_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id), CONSTRAINT fk_user_domains_user_id FOREIGN KEY (user_id) REFERENCES public.profiles(id) ); CREATE TABLE public.user_violations ( user_id uuid NOT NULL, wildcard_attempts integer DEFAULT 0, last_attempt timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now(), CONSTRAINT user_violations_pkey PRIMARY KEY (user_id), CONSTRAINT user_violations_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ); CREATE TABLE public.zones ( id integer NOT NULL DEFAULT nextval('zones_id_seq'::regclass), domain character varying NOT NULL UNIQUE, status character varying DEFAULT 'active'::character varying, CONSTRAINT zones_pkey PRIMARY KEY (id) );
大佬要注意身体哦
可以共享、可以push的免费邮箱,更可使用自定义域名,完美契合您的各项需求。
2 条回复
排序