/*
 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:06:05
*/

PRAGMA foreign_keys = false;

-- ----------------------------
-- Table structure for device_model_group
-- ----------------------------

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

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

-- ----------------------------
-- Triggers structure for table device_model_group
-- ----------------------------
CREATE TRIGGER "update_dev_model_group_id"
AFTER UPDATE OF "id"
ON "device_model_group"
BEGIN
    UPDATE dev_model SET group_id = NEW.id
    WHERE dev_model.group_id = OLD.id;
END;

PRAGMA foreign_keys = true;
