/*
 Navicat Premium Data Transfer

 Source Server         : data
 Source Server Type    : SQLite
 Source Server Version : 3021000
 Source Schema         : main

 Target Server Type    : SQLite
 Target Server Version : 3021000
 File Encoding         : 65001

 Date: 06/09/2024 11:05:56
*/

PRAGMA foreign_keys = false;

-- ----------------------------
-- Table structure for device_group
-- ----------------------------

CREATE TABLE "device_group" (
  "id" text NOT NULL,
  "name" TEXT
);

-- ----------------------------
-- Records of device_group
-- ----------------------------
INSERT INTO "device_group" VALUES ('00000000-0000-0000-0000-000000000000', '默认分组');

-- ----------------------------
-- Triggers structure for table device_group
-- ----------------------------
CREATE TRIGGER "update_device_group_id"
AFTER UPDATE OF "id"
ON "device_group"
BEGIN
    UPDATE device SET group_id = NEW.id
    WHERE device.group_id = OLD.id;
END;

PRAGMA foreign_keys = true;
