a.sql 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. alter table provider
  2. add column sort_name varchar(255) not null default '',
  3. add index sort_name(sort_name);
  4. add column company_code varchar(50) not null default '' ,
  5. add index company_code(company_code);
  6. select * from parts where partscode='04.06.03.02.000089';
  7. update parts set unit='桶' where partscode='04.06.03.02.000089';
  8. select * from warehourse limit 10;
  9. select * from warehouse_provider limit 10;
  10. insert into warehouse
  11. (warehosetName,warehoseCode,pid,pastureId,isWhPostion,enable)
  12. values('test-001','TT-001',2954,18,1,1) ;
  13. select * from warehouse where warehosetName='test-001';
  14. insert into warehouse_provider (warehouseId,providerId) values(27177,2954);
  15. alter table equipment add column modifyTime datetime ;
  16. alter table equipment add column CompanyCode varchar(50) not null default '' ;
  17. alter table equipment add column Quantity varchar(50) not null default 0 ;
  18. alter table equipment add column CostCenter varchar(50) not null default '' ;
  19. alter table equipment add column Unit varchar(50) not null default '' ;
  20. alter table equipment add column ProfitCenter varchar(50) not null default '';
  21. alter table equipment add column created_at datetime;
  22. alter table equipment add column updated_at datetime;
  23. alter table equipment add column sonCode varchar(50) not null default '';
  24. alter table BigPartUse
  25. add column ProofCode varchar(50) not null default ''
  26. alter table BigPartrefund
  27. add column ProofCode varchar(50) not null default ''
  28. alter table BigBuyDetail add column srmStatus integer default 0;
  29. alter table BigBuyDetail add column srmNumber varchar(50) default '';
  30. alter table BigBuyDetail add column sapError varchar(100) default '';
  31. alter table BigBuyDetail add column srmError varchar(100) default '';
  32. srmStatus
  33. srmNumber
  34. sapError
  35. srmError
  36. add column SapStatus int not null default 0
  37. add column sapNumber varchar(50) not null default ''
  38. alter table BigPartLaid
  39. add column ProofCode varchar(50) not null default ''
  40. add column Proofyear varchar(50) not null default ''
  41. modify contractId bigint not null default 0
  42. add column rowNumber int(10) default 0
  43. alter table partlaid add column dflag int(8) default 0;
  44. alter table PartUse add column dflag int(8) default 0;
  45. alter table Partquit add column dflag int(8) default 0;
  46. alter table PartRefund add column dflag int(8) default 0;
  47. add column rowNumber int(10) default 0
  48. modify contractId bigint not null default 0
  49. add column dflag int not null default 0;
  50. alter table Partquit add column rowNumber int(10) default 0;
  51. alter table PartRefund add column rowNumber int(10) default 0;
  52. alter table sapLog
  53. add column status varchar(56) not null default ''comment '状态',
  54. add column msgtext varchar(256) not null default ''comment '消息';
  55. modify column param text;
  56. alter table provider add column updated_at datetime ;
  57. add column created_at datetime;
  58. add column modifyTime datetime ,
  59. alter table parts
  60. add column modifyTime datetime ,
  61. add column created_at datetime;
  62. alter table equipment add column updated_at datetime ,add column created_at datetime,add column modifyTime datetime ;
  63. alter table provider drop key providerName;
  64. show index from provider;
  65. alter table pasture add column parchase_organization varchar(50) default ''
  66. rename column company_name to companyname
  67. add column factory_code varchar(56) not null default '' ,
  68. add column factory_name varchar(56) not null default '',
  69. add column company_code varchar(56) not null default '' ,
  70. add column company_name varchar(112) not null default '',
  71. add index (factory_name)
  72. alter table warehouse
  73. add column factory_code varchar(56) not null default '' ,
  74. add column factory_name varchar(56) not null default ''
  75. insert into warehouse (factory_code,factory_name,warehoseCode,warehosetName,enable)
  76. alter table warehouse add column pasture_name varchar(56) default ''
  77. add index (warehoseCode,warehosetName)
  78. drop index warehoseCode;
  79. alter table buydetail
  80. add column rowNumber INT default 0
  81. alter table contract
  82. modify id int(11) not null auto_increment
  83. delete from warehouse where warehoseCode <> ''
  84. show create table pasture;
  85. select contractId from partlaid order by contractId desc limit 1
  86. select * from contract where id =623930
  87. alter table equipment
  88. add unique index (eqcode)
  89. add column soncode varchar(50) default ''
  90. alter table department
  91. rename column CostCenter_code to costCenter_code
  92. add column pasturename varchar(100) default ''
  93. alter table temDict
  94. add CostCenter varchar(50) default '',
  95. add deptname varchar(50) default ''
  96. alter table parts add column old_partcode varchar(50) default '';
  97. alter table parts add index (old_partcode);
  98. alter table parts add unique index(partcode,name,specification) ;
  99. alter table parts add unique index(partcode) ;
  100. alter table parts drop index partCode ;
  101. alter table parts add column new_partcode varchar(50) default '';
  102. alter table parts add column isSave integer default 0;
  103. alter table parts add unique index (partcode) ;
  104. delete from parts where partcode like '14%'
  105. select count(id) from parts where partcode like '14%'
  106. -- count =31568
  107. alter table part_class add column pname varchar(50) default '';
  108. alter table part_class add column new_partcode varchar(50) default '';
  109. alter table BigPartTransfer add column deptId integer default 0;
  110. alter table BigPartTransfer add column sapStatus integer default 0;
  111. alter table BigPartTransfer add column sapText text default '';
  112. alter table emp add index(pastureId)
  113. -- alter table equipment modify column employeeId bigint(50)
  114. alter table equipment add index(employeName)