Skip to content

Commit

Permalink
instead of using SERIAL, use the new IDENTITY column introduced in po…
Browse files Browse the repository at this point in the history
…stgres 10.
  • Loading branch information
jqnatividad committed Feb 29, 2020
1 parent ae2de88 commit ec6807c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions air-quality/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ CREATE DATABASE airquality;
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;

CREATE TABLE measurement_types (
parameter_id SERIAL PRIMARY KEY,
parameter_id GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
parameter TEXT NOT NULL,
unit TEXT NOT NULL,
UNIQUE(parameter, unit)
);

CREATE TABLE locations (
location_id SERIAL PRIMARY KEY,
location_id GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
city_name TEXT NOT NULL,
country_name TEXT NOT NULL,
location_name TEXT NOT NULL,
Expand Down

0 comments on commit ec6807c

Please sign in to comment.