

CREATE TABLE IF NOT EXISTS public.station_types
(
    id SERIAL NOT NULL,
    name character varying(255) COLLATE pg_catalog."default" NOT NULL,
    CONSTRAINT station_types_pkey PRIMARY KEY (id)
);

-- add station type column
alter table stations drop column type_id -- Caso necessario
alter table stations add column type_id integer not null references station_types(id) default 1;

insert into station_types (id, name) values (1, 'Física');
insert into station_types (id, name) values (2, 'Virtual');