init.sql 12.4 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_currency" (
    "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "show" tinyint,
    "huilv" float(11,9),
    "aorder" int,
    "create_at" datetime,
    "update_at" datetime,
    PRIMARY KEY ("id")
) COMMENT '货币单位管理';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_currency";

-- 计量单位
-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_unit" (
                                          "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '计量单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_unit";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_unit" (
                                          "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '计量单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_unit";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_bank_account" (
                                                  "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                  "ba_account_name" varchar(100) NOT NULL,
    "ba_bank_name" varchar(100) NOT NULL,
    "ba_account_num" varchar(100) NOT NULL,
    "ba_swift_code" varchar(30) NOT NULL,
    "ba_bank_add" varchar(30) NOT NULL,
    "ba_type" tinyint NOT NULL,
    "source" varchar(30) NOT NULL,
    "status" tinyint NOT NULL,
    "creator" varchar(64) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(64) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '银行账户表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_bank_account";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_region" (
                                            "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                            "title_zh" varchar(255) NOT NULL,
    "title_en" varchar(255) NOT NULL,
    "short_name" varchar(100) NOT NULL,
    "language" varchar(100) NOT NULL,
    "type" char(50) NOT NULL,
    "parent_id" bigint NOT NULL,
    "sort" int NOT NULL,
    "status" tinyint NOT NULL,
    "creator" varchar(64) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(64) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '区域设置表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_region";



-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_zhong_pao" (
                                               "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                               "pao_linjie" varchar(127),
                                               "pao_gs" varchar(127),
                                               "pao_ys_ids" varchar(255),
                                               "pao_is_open" tinyint(1) NOT NULL,
                                               "zhong_linjie" varchar(127),
                                               "zhong_gs" varchar(127),
                                               "zhong_ys_ids" varchar(255),
                                               "zhong_is_open" tinyint(1) NOT NULL,
                                               "creator" varchar(63) DEFAULT '',
                                               "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                               "updater" varchar(63) DEFAULT '',
                                               "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                               "deleted" bit NOT NULL DEFAULT FALSE,
                                               PRIMARY KEY ("id")
) COMMENT '重泡货配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_zhong_pao";


-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_order_code" (
                                                "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                "title" varchar(127) NOT NULL,
                                                "start_code" bigint NOT NULL,
                                                "end_code" bigint,
                                                "creator" varchar(63) DEFAULT '',
                                                "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                "updater" varchar(63) DEFAULT '',
                                                "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                "deleted" bit NOT NULL DEFAULT FALSE,
                                                PRIMARY KEY ("id")
) COMMENT '单号配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_order_code";





-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_cabinet" (
                                             "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                             "name" varchar(127) NOT NULL,
                                             "volume" decimal(10,2),
                                             "weight" decimal(10,2),
                                             "status" tinyint NOT NULL,
                                             "sort" int NOT NULL,
                                             "creator" varchar(63) DEFAULT '',
                                             "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                             "updater" varchar(63) DEFAULT '',
                                             "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                             "deleted" bit NOT NULL DEFAULT FALSE,
                                             PRIMARY KEY ("id")
) COMMENT '柜型配置';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_cabinet";



-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_currency_ecash" (
                                                    "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                    "title_zh" varchar(100),
    "title_en" varchar(100),
    "fuhao" varchar(255),
    "status" tinyint(1),
    "huilv" float(13,4),
    "aorder" int,
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "creator" varchar(255) DEFAULT '',
    "updater" varchar(255) DEFAULT '',
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT 'E-Cash汇率单位表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_currency_ecash";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_busi_pwd" (
                                              "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                              "busi_type" varchar(5),
    "pwd" varchar(64),
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '业务密码表,存储一些业务中使用的密码';

DELETE FROM "ecw_busi_pwd";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_product_brank" (
                                                   "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                   "title_zh" varchar(255),
    "title_en" varchar(255),
    "aorder" int,
    "filing" char(20),
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '品牌表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_product_brank";

-- 将该建表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "ecw_product_brand_empower" (
                                                           "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                           "product_brand_id" bigint NOT NULL,
                                                           "customer_id" bigint NOT NULL,
                                                           "customer_contacts_id" bigint NOT NULL,
                                                           "start_time" datetime,
                                                           "end_time" datetime,
                                                           "file_url" varchar(255) NOT NULL,
    "fee_scale" tinyint NOT NULL,
    "status" tinyint NOT NULL,
    "create_user_id" bigint NOT NULL,
    "create_username" varchar(255) NOT NULL,
    "creator" varchar(32) DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar(32) DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
    ) COMMENT '商品品牌授权表';

-- 将该删表 SQL 语句,添加到 yudao-module-ecw-impl 模块的 test/resources/sql/clean.sql 文件里
DELETE FROM "ecw_product_brand_empower";