Untitled
unknown
plain_text
10 months ago
3.3 kB
13
Indexable
-- WARNING: This schema is for context only and is not meant to be run. -- Table order and constraints may not be valid for execution. CREATE TABLE public.configuracoes_sistema ( id uuid NOT NULL DEFAULT gen_random_uuid(), chave text NOT NULL UNIQUE, valor text NOT NULL, tipo_valor USER-DEFINED NOT NULL, descricao text, editavel boolean NOT NULL DEFAULT true, created_at timestamp with time zone NOT NULL DEFAULT now(), updated_at timestamp with time zone NOT NULL DEFAULT now(), CONSTRAINT configuracoes_sistema_pkey PRIMARY KEY (id) ); CREATE TABLE public.coordenadas_geograficas ( id uuid NOT NULL DEFAULT gen_random_uuid(), municipio text NOT NULL, uf text NOT NULL CHECK (length(uf) = 2), latitude numeric NOT NULL, longitude numeric NOT NULL, codigo_ibge integer, created_at timestamp with time zone NOT NULL DEFAULT now(), CONSTRAINT coordenadas_geograficas_pkey PRIMARY KEY (id) ); CREATE TABLE public.equipamentos ( id uuid NOT NULL DEFAULT gen_random_uuid(), codigo text NOT NULL UNIQUE, fabricante text NOT NULL, tipo_equipamento USER-DEFINED NOT NULL, potencia_kwp numeric, potencia_kva numeric, corrente_a numeric, preco numeric NOT NULL, ativo boolean NOT NULL DEFAULT true, created_at timestamp with time zone NOT NULL DEFAULT now(), updated_at timestamp with time zone NOT NULL DEFAULT now(), CONSTRAINT equipamentos_pkey PRIMARY KEY (id) ); CREATE TABLE public.irradiacao_solar ( id uuid NOT NULL DEFAULT gen_random_uuid(), num integer, lat numeric NOT NULL, lon numeric NOT NULL, num2 integer, media numeric NOT NULL, jan numeric, feb numeric, mar numeric, apr numeric, may numeric, jun numeric, jul numeric, aug numeric, sep numeric, oct numeric, nov numeric, dez numeric, created_at timestamp with time zone NOT NULL DEFAULT now(), CONSTRAINT irradiacao_solar_pkey PRIMARY KEY (id) ); CREATE TABLE public.simulacoes ( id uuid NOT NULL DEFAULT gen_random_uuid(), cliente_nome text NOT NULL, cliente_email text, cliente_telefone text, cliente_endereco text, cliente_cidade text NOT NULL, cliente_estado text NOT NULL, cliente_cep text, consumo_mensal numeric NOT NULL, demanda numeric, fator_potencia numeric, preco_kwh numeric NOT NULL, irradiacao_solar numeric NOT NULL, fator_perdas numeric NOT NULL, potencia_necessaria numeric NOT NULL, potencia_real numeric NOT NULL, quantidade_modulos integer NOT NULL, modulo_selecionado text NOT NULL, inversor_selecionado text NOT NULL, geracao_mensal_estimada numeric NOT NULL, custo_modulos numeric NOT NULL, custo_inversor numeric NOT NULL, custo_total numeric NOT NULL, preco_kwp numeric NOT NULL, latitude numeric, longitude numeric, created_at timestamp with time zone NOT NULL DEFAULT now(), updated_at timestamp with time zone NOT NULL DEFAULT now(), tipo_ligacao text, classificacao_tarifaria text, tipo_instalacao text DEFAULT 'telhado'::text, area_disponivel numeric, cliente_cpf_cnpj text, tipo_cliente text DEFAULT 'residencial'::text, demanda_contratada numeric, payback_anos numeric, economia_mensal numeric, tipo_simulacao text DEFAULT 'rapida'::text, CONSTRAINT simulacoes_pkey PRIMARY KEY (id) );
Editor is loading...
Leave a Comment