web-mon-backend

View on GitHub

a_works

Description

A work (car works)

Table Definition ```sql CREATE TABLE `a_works` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'counter to identify each record', `office_id` bigint unsigned NOT NULL COMMENT 'target office id', `work_name` varchar(64) NOT NULL COMMENT 'work name', `car_type_id` bigint unsigned NOT NULL COMMENT 'car type id that can use to this work', PRIMARY KEY (`id`), UNIQUE KEY `office_id` (`office_id`,`work_name`), KEY `car_type_id` (`car_type_id`), CONSTRAINT `a_works_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `offices` (`id`) ON DELETE CASCADE, CONSTRAINT `a_works_ibfk_2` FOREIGN KEY (`car_type_id`) REFERENCES `car_types` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='A work (car works)' ```

Columns

# Name Type Default Nullable Extra Definition Children Parents Comment
1 id bigint unsigned   false auto_increment a_work_sta_relations   counter to identify each record
2 office_id bigint unsigned   false     offices target office id
3 work_name varchar(64)   false       work name
4 car_type_id bigint unsigned   false     car_types car type id that can use to this work

Constraints

# Name Type Definition
1 a_works_ibfk_1 FOREIGN KEY FOREIGN KEY (office_id) REFERENCES offices (id)
2 a_works_ibfk_2 FOREIGN KEY FOREIGN KEY (car_type_id) REFERENCES car_types (id)
3 office_id UNIQUE UNIQUE KEY office_id (office_id, work_name)
4 PRIMARY PRIMARY KEY PRIMARY KEY (id)

Indexes

# Name Definition
1 car_type_id KEY car_type_id (car_type_id) USING BTREE
2 PRIMARY PRIMARY KEY (id) USING BTREE
3 office_id UNIQUE KEY office_id (office_id, work_name) USING BTREE

Relations

er


Generated by tbls