test.sql 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Create Tables */
  2. -- 测试数据
  3. CREATE TABLE test_data
  4. (
  5. id varchar(64) NOT NULL,
  6. test_input varchar(200),
  7. test_textarea varchar(200),
  8. test_select varchar(10),
  9. test_select_multiple varchar(200),
  10. test_radio varchar(10),
  11. test_checkbox varchar(200),
  12. test_date timestamp,
  13. test_datetime timestamp,
  14. test_user_code varchar(64),
  15. test_office_code varchar(64),
  16. test_area_code varchar(64),
  17. test_area_name varchar(100),
  18. status char(1) DEFAULT '0' NOT NULL,
  19. create_by varchar(64) NOT NULL,
  20. create_date timestamp NOT NULL,
  21. update_by varchar(64) NOT NULL,
  22. update_date timestamp NOT NULL,
  23. remarks varchar(500),
  24. PRIMARY KEY (id)
  25. ) WITHOUT OIDS;
  26. -- 测试数据子表
  27. CREATE TABLE test_data_child
  28. (
  29. id varchar(64) NOT NULL,
  30. test_sort int,
  31. test_data_id varchar(64),
  32. test_input varchar(200),
  33. test_textarea varchar(200),
  34. test_select varchar(10),
  35. test_select_multiple varchar(200),
  36. test_radio varchar(10),
  37. test_checkbox varchar(200),
  38. test_date timestamp,
  39. test_datetime timestamp,
  40. test_user_code varchar(64),
  41. test_office_code varchar(64),
  42. test_area_code varchar(64),
  43. test_area_name varchar(100),
  44. PRIMARY KEY (id)
  45. ) WITHOUT OIDS;
  46. -- 测试树表
  47. CREATE TABLE test_tree
  48. (
  49. tree_code varchar(64) NOT NULL,
  50. parent_code varchar(64) NOT NULL,
  51. parent_codes varchar(767) NOT NULL,
  52. tree_sort decimal(10) NOT NULL,
  53. tree_sorts varchar(767) NOT NULL,
  54. tree_leaf char(1) NOT NULL,
  55. tree_level decimal(4) NOT NULL,
  56. tree_names varchar(767) NOT NULL,
  57. tree_name varchar(200) NOT NULL,
  58. status char(1) DEFAULT '0' NOT NULL,
  59. create_by varchar(64) NOT NULL,
  60. create_date timestamp NOT NULL,
  61. update_by varchar(64) NOT NULL,
  62. update_date timestamp NOT NULL,
  63. remarks varchar(500),
  64. PRIMARY KEY (tree_code)
  65. ) WITHOUT OIDS;
  66. /* Comments */
  67. COMMENT ON TABLE test_data IS '测试数据';
  68. COMMENT ON COLUMN test_data.id IS '编号';
  69. COMMENT ON COLUMN test_data.test_input IS '单行文本';
  70. COMMENT ON COLUMN test_data.test_textarea IS '多行文本';
  71. COMMENT ON COLUMN test_data.test_select IS '下拉框';
  72. COMMENT ON COLUMN test_data.test_select_multiple IS '下拉多选';
  73. COMMENT ON COLUMN test_data.test_radio IS '单选框';
  74. COMMENT ON COLUMN test_data.test_checkbox IS '复选框';
  75. COMMENT ON COLUMN test_data.test_date IS '日期选择';
  76. COMMENT ON COLUMN test_data.test_datetime IS '日期时间';
  77. COMMENT ON COLUMN test_data.test_user_code IS '用户选择';
  78. COMMENT ON COLUMN test_data.test_office_code IS '机构选择';
  79. COMMENT ON COLUMN test_data.test_area_code IS '区域选择';
  80. COMMENT ON COLUMN test_data.test_area_name IS '区域名称';
  81. COMMENT ON COLUMN test_data.status IS '状态(0正常 1删除 2停用)';
  82. COMMENT ON COLUMN test_data.create_by IS '创建者';
  83. COMMENT ON COLUMN test_data.create_date IS '创建时间';
  84. COMMENT ON COLUMN test_data.update_by IS '更新者';
  85. COMMENT ON COLUMN test_data.update_date IS '更新时间';
  86. COMMENT ON COLUMN test_data.remarks IS '备注信息';
  87. COMMENT ON TABLE test_data_child IS '测试数据子表';
  88. COMMENT ON COLUMN test_data_child.id IS '编号';
  89. COMMENT ON COLUMN test_data_child.test_sort IS '排序号';
  90. COMMENT ON COLUMN test_data_child.test_data_id IS '父表主键';
  91. COMMENT ON COLUMN test_data_child.test_input IS '单行文本';
  92. COMMENT ON COLUMN test_data_child.test_textarea IS '多行文本';
  93. COMMENT ON COLUMN test_data_child.test_select IS '下拉框';
  94. COMMENT ON COLUMN test_data_child.test_select_multiple IS '下拉多选';
  95. COMMENT ON COLUMN test_data_child.test_radio IS '单选框';
  96. COMMENT ON COLUMN test_data_child.test_checkbox IS '复选框';
  97. COMMENT ON COLUMN test_data_child.test_date IS '日期选择';
  98. COMMENT ON COLUMN test_data_child.test_datetime IS '日期时间';
  99. COMMENT ON COLUMN test_data_child.test_user_code IS '用户选择';
  100. COMMENT ON COLUMN test_data_child.test_office_code IS '机构选择';
  101. COMMENT ON COLUMN test_data_child.test_area_code IS '区域选择';
  102. COMMENT ON COLUMN test_data_child.test_area_name IS '区域名称';
  103. COMMENT ON TABLE test_tree IS '测试树表';
  104. COMMENT ON COLUMN test_tree.tree_code IS '节点编码';
  105. COMMENT ON COLUMN test_tree.parent_code IS '父级编号';
  106. COMMENT ON COLUMN test_tree.parent_codes IS '所有父级编号';
  107. COMMENT ON COLUMN test_tree.tree_sort IS '排序号(升序)';
  108. COMMENT ON COLUMN test_tree.tree_sorts IS '所有排序号';
  109. COMMENT ON COLUMN test_tree.tree_leaf IS '是否最末级';
  110. COMMENT ON COLUMN test_tree.tree_level IS '层次级别';
  111. COMMENT ON COLUMN test_tree.tree_names IS '全节点名';
  112. COMMENT ON COLUMN test_tree.tree_name IS '节点名称';
  113. COMMENT ON COLUMN test_tree.status IS '状态(0正常 1删除 2停用)';
  114. COMMENT ON COLUMN test_tree.create_by IS '创建者';
  115. COMMENT ON COLUMN test_tree.create_date IS '创建时间';
  116. COMMENT ON COLUMN test_tree.update_by IS '更新者';
  117. COMMENT ON COLUMN test_tree.update_date IS '更新时间';
  118. COMMENT ON COLUMN test_tree.remarks IS '备注信息';