sz-rust-cli 1.4.0

SZ-Rust 命令行工具:项目脚手架、数据库迁移、调度器管理
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Generated by sz-rust-cli make:plugin --template {{ template_type }} --name {{ plugin_name }}
-- Generation time: {{ generated_at }}
-- DO NOT EDIT MANUALLY

CREATE TABLE IF NOT EXISTS `{{ table_name }}` (
    {%- for field in fields %}
    `{{ field.name }}` {{ field.sql_type }} {%- if field.nullable %} NULL{%- else %} NOT NULL{%- endif %}{%- if field.default %} DEFAULT {{ field.default }}{%- endif %},
    {%- endfor %}
    `current_state` VARCHAR(50) NOT NULL DEFAULT '{{ initial_state }}',
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`{{ primary_key_name }}`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Index for state filtering
CREATE INDEX `idx_{{ table_name }}_state` ON `{{ table_name }}` (`current_state`);