 -- CREATE UNIQUE INDEX uix_slaves_hostname ON "slaves"("hostname")
 
 CREATE TABLE "mongod_states" (
-	"id" SERIAL PRIMARY KEY,
+	"id" BIGSERIAL PRIMARY KEY,
 	"parent_mongod_id" integer NOT NULL, -- foreign key constraint added below
 	"is_sharding_config_server" bool,
 	"execution_state" integer
 );
 
 CREATE TABLE "mongods" (
-	"id" SERIAL PRIMARY KEY,
+	"id" BIGSERIAL PRIMARY KEY,
 	"port" integer,
 	"repl_set_name" varchar(255),
 	"observation_error_id" integer NULL REFERENCES msp_errors(id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,

-- CREATE UNIQUE INDEX uix_replica_sets_name ON "replica_sets"("name");

CREATE TABLE "msp_errors" (
	"id" SERIAL PRIMARY KEY,
	"identifier" varchar(255),
	"description" varchar(255),
	"long_description" varchar(255)
);

CREATE TABLE slaves (
	"id" SERIAL PRIMARY KEY,
	"hostname" varchar(255),
	"port" integer,
	"mongod_port_range_begin" integer,
	"mongod_port_range_end" integer,

START TRANSACTION;

CREATE TABLE "risk_groups" (
	"id" BIGSERIAL PRIMARY KEY,
	"name" varchar(255) UNIQUE
);

-- CREATE UNIQUE INDEX uix_risk_groups_name ON "risk_groups"("name");

CREATE TABLE "replica_sets" (
	"id" BIGSERIAL PRIMARY KEY,
	"name" varchar(255) UNIQUE,
	"persistent_member_count" integer,
	"volatile_member_count" integer,
	"configure_as_sharding_config_server" bool
