sign_up_db.sql 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # (fat 1, uat 1, prod 0)
  2. CREATE TABLE `sign_up` (
  3. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '签约ID',
  4. sex tinyint(4) NOT NULL DEFAULT '0' COMMENT '性别,性别 0:保密 1:男 2:女',
  5. mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up主id',
  6. begin_date date NOT NULL DEFAULT '0000-00-00' COMMENT '签约开始时间',
  7. end_date date NOT NULL DEFAULT '0000-00-00' COMMENT '签约结束时间',
  8. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常,100删除',
  9. country varchar(16) NOT NULL DEFAULT '' COMMENT '国家',
  10. province varchar(16) NOT NULL DEFAULT '' COMMENT '省',
  11. city varchar(16) NOT NULL DEFAULT '' COMMENT '市',
  12. note varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  13. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  14. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  15. PRIMARY KEY (id),
  16. KEY ix_mid (mid),
  17. KEY ix_begin_date (begin_date),
  18. KEY ix_end_date (end_date),
  19. KEY ix_mtime (mtime)
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='签约表';
  21. -- 付款表
  22. CREATE TABLE sign_pay (
  23. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  24. mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up主id',
  25. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签约ID',
  26. due_date date NOT NULL DEFAULT '0000-00-00' COMMENT '签约结束时间',
  27. pay_value BIGINT(20) NOT NULL DEFAULT '0' COMMENT '金额',
  28. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0未支付,1已支付,100删除',
  29. note varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  30. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  31. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  32. PRIMARY KEY (id),
  33. KEY ix_signid (sign_id),
  34. KEY ix_mid (mid),
  35. KEY ix_date (due_date),
  36. KEY ix_mtime (mtime)
  37. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='付款表';
  38. CREATE TABLE sign_task (
  39. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '任务ID',
  40. mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up主id',
  41. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签约ID',
  42. task_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '任务类型',
  43. task_counter int(11) NOT NULL DEFAULT '0' COMMENT '任务计数器',
  44. task_condition int(11) NOT NULL DEFAULT '0' COMMENT '任务条件',
  45. task_data varchar(1024) NOT NULL DEFAULT '' COMMENT '任务存储相关数据', -- 任务数据,比如用来存已经投过的稿件id
  46. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常,1过期,100删除',
  47. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '任务生成时间',
  48. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  49. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  50. PRIMARY KEY (id),
  51. KEY ix_mid (mid),
  52. KEY ix_signid (sign_id),
  53. KEY ix_date (generate_date),
  54. KEY ix_mtime (mtime)
  55. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='任务表';
  56. -- 合同表
  57. CREATE TABLE sign_contract (
  58. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '合同ID',
  59. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签约ID',
  60. mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up主id',
  61. filename varchar(255) NOT NULL DEFAULT '' COMMENT '合同名',
  62. filelink varchar(255) NOT NULL DEFAULT '' COMMENT '文件链接地址',
  63. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常,100删除',
  64. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  65. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  66. PRIMARY KEY (id),
  67. KEY ix_mid (mid),
  68. KEY ix_signid (sign_id),
  69. KEY ix_mtime (mtime)
  70. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合同表';
  71. # (fat 1, uat 1, prod 1)
  72. alter table sign_up add column admin_id int(11) not null default 0 comment '管理员id';
  73. alter table sign_up add column admin_name varchar(32) not null default '' comment '管理员name';
  74. # (fat 1, uat 1, prod 1) --2018.06.26
  75. alter table sign_up add column email_state tinyint(4) not null default 0 comment '邮件发送情况,0未发送,1已发送过提醒邮件';
  76. alter table sign_pay add column email_state tinyint(4) not null default 0 comment '邮件发送情况,0未发送,1已发送过提醒邮件';