CREATE TABLE "main"."expert" (
  "id" INTEGER NOT NULL,
  "uid" text NOT NULL DEFAULT '',
  "sec_uid" text NOT NULL DEFAULT '',
  "short_id" text NOT NULL DEFAULT '',
  "real_name" text NOT NULL DEFAULT '',
  "nick_name" text NOT NULL DEFAULT '',
  "state" text NOT NULL DEFAULT 'enable',
  "since" INTEGER NOT NULL DEFAULT 0,
  "config" text NOT NULL DEFAULT '',
  "config_at" INTEGER NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX "main"."idx_expert_uid" ON "expert" (
  "uid"
);

CREATE TABLE "main"."follower" (
  "id" INTEGER NOT NULL,
  "avatar" TEXT NOT NULL DEFAULT '',
  "nickname" TEXT NOT NULL DEFAULT '',
  "sec_uid" text NOT NULL DEFAULT '',
  "short_id" text NOT NULL DEFAULT '',
  "uid" text NOT NULL DEFAULT '',
  "unique_id" text NOT NULL DEFAULT '',
  "expert_uid" text NOT NULL DEFAULT '',
  "followed" INTEGER NOT NULL DEFAULT 0,
  "created_at" INTEGER NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX "main"."idx_follower_uid" ON "follower" (
  "uid"
);

CREATE TABLE "main"."device" (
  "id" INTEGER NOT NULL,
  "uuid" text NOT NULL DEFAULT '',
  "name" text NOT NULL DEFAULT '',
  "expert" text NOT NULL DEFAULT '',
  "state" text NOT NULL DEFAULT 'enable',
  "note" text NOT NULL DEFAULT '',
  PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX "main"."idx_device_uuid" ON "device" (
  "uuid"
);