CREATE TABLE meter ( id serial PRIMARY KEY NOT NULL, name varchar(255) NOT NULL, fortop_uid varchar(50) NOT NULL ); DELETE FROM measurement; ALTER TABLE measurement ADD meter_id integer NOT NULL;