DROP TABLE IF EXISTS country;

-- DROP SEQUENCE IF EXISTS country_country_id_seq;
-- CREATE SEQUENCE country_country_id_seq;


CREATE TABLE country (
  "country_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
  "name" varchar(128) NOT NULL,
  "iso_code_2" varchar(2) NOT NULL,
  "iso_code_3" varchar(3) NOT NULL,
  "status" smallint NOT NULL DEFAULT 0
  -- PRIMARY KEY("country_id")
);

SELECT setval('country_country_id_seq', 257, true); -- last inserted id by sample data
