 -- ----------------------------
 DROP TABLE IF EXISTS "api"."message_reply";
 CREATE TABLE "api"."message_reply" (
-    "id" bigint NOT NULL DEFAULT nextval('api.message_reply_id_seq'::regclass),
-    "message_id" bigint NOT NULL DEFAULT 0,
-    "reply_id" bigint NOT NULL DEFAULT 0,
-    "meta_bits" smallint NOT NULL DEFAULT 0::smallint,
-    "created_at" timestamp(6) WITH TIME ZONE NOT NULL DEFAULT now()
-)
-WITH (OIDS=FALSE);
+    "id" BIGINT NOT NULL DEFAULT nextval(
+        'api.message_reply_id_seq' :: regclass
+    ),
+    "message_id" BIGINT NOT NULL DEFAULT 0,
+    "reply_id" BIGINT NOT NULL DEFAULT 0,
+    "meta_bits" SMALLINT NOT NULL DEFAULT 0 :: SMALLINT,
+    "created_at" TIMESTAMP (6) WITH TIME ZONE NOT NULL DEFAULT now()
+) WITH (OIDS = FALSE);
+
 -- ALTER TABLE "api"."message_reply" OWNER TO "socialapplication";
 GRANT SELECT, INSERT, DELETE ON "api"."message_reply" TO "socialapplication";

    'left',
    'requestpending'
);
ALTER TYPE "api"."channel_participant_status_constant_enum" OWNER TO "social";

DROP TABLE IF EXISTS "api"."channel_participant";
CREATE TABLE "api"."channel_participant" (
    "id" bigint NOT NULL DEFAULT nextval('api.channel_participant_id_seq'::regclass),
    "channel_id" bigint NOT NULL DEFAULT 0,
    "account_id" bigint NOT NULL DEFAULT 0,
    "status_constant" "api"."channel_participant_status_constant_enum",
    "meta_bits" smallint NOT NULL DEFAULT 0::smallint,
    "last_seen_at" timestamp(6) WITH TIME ZONE NOT NULL DEFAULT now(),
    "created_at" timestamp(6) WITH TIME ZONE NOT NULL DEFAULT now(),
    "updated_at" timestamp(6) WITH TIME ZONE NOT NULL DEFAULT now()
)
WITH (OIDS=FALSE);
-- ALTER TABLE "api"."channel_participant" OWNER TO "socialapplication";
GRANT SELECT, INSERT, UPDATE ON "api"."channel_participant" TO "socialapplication";


-- ----------------------------
DROP TABLE IF EXISTS "api"."account";
CREATE TABLE "api"."account" (
    "id" BIGINT NOT NULL DEFAULT nextval('api.account_id_seq' :: regclass),
    "old_id" VARCHAR (24) NOT NULL COLLATE "default",
    "is_troll" BOOLEAN NOT NULL DEFAULT FALSE,
    "nick" VARCHAR (25) NOT NULL CHECK ("nick" <> '')
) WITH (OIDS = FALSE);

-- ALTER TABLE "api"."account" OWNER TO "socialapplication";
GRANT SELECT, INSERT ON "api"."account" TO "socialapplication";

