a.sql 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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
  16. add column CompanyCode varchar(50) not null default '' ,
  17. add column Quantity varchar(50) not null default 0 ,
  18. add column CostCenter varchar(50) not null default '' ,
  19. add column Unit varchar(50) not null default '' ,
  20. add column ProfitCenter varchar(50) not null default ''
  21. alter table BigPartUse
  22. add column ProofCode varchar(50) not null default ''
  23. alter table BigPartrefund
  24. add column ProofCode varchar(50) not null default ''
  25. alter table BigBuyDetail
  26. add column SapStatus int not null default 0
  27. add column sapNumber varchar(50) not null default ''
  28. alter table BigPartLaid
  29. add column ProofCode varchar(50) not null default ''
  30. add column Proofyear varchar(50) not null default ''
  31. modify contractId bigint not null default 0
  32. add column rowNumber int(10) default 0
  33. alter table partlaid add column dflag int(8) default 0;
  34. alter table PartUse add column dflag int(8) default 0;
  35. alter table Partquit add column dflag int(8) default 0;
  36. alter table PartRefund add column dflag int(8) default 0;
  37. add column rowNumber int(10) default 0
  38. modify contractId bigint not null default 0
  39. add column dflag int not null default 0;
  40. alter table Partquit add column rowNumber int(10) default 0;
  41. alter table PartRefund add column rowNumber int(10) default 0;
  42. alter table sapLog
  43. add column status varchar(56) not null default ''comment '状态',
  44. add column msgtext varchar(256) not null default ''comment '消息';
  45. modify column param text;
  46. alter table provider add column updated_at datetime ;
  47. add column created_at datetime;
  48. add column modifyTime datetime ,
  49. alter table parts
  50. add column modifyTime datetime ,
  51. add column created_at datetime;
  52. alter table equipment add column updated_at datetime ,add column created_at datetime,add column modifyTime datetime ;
  53. alter table provider drop key providerName;
  54. show index from provider;
  55. alter table pasture add column parchase_organization varchar(50) default ''
  56. rename column company_name to companyname
  57. add column factory_code varchar(56) not null default '' ,
  58. add column factory_name varchar(56) not null default '',
  59. add column company_code varchar(56) not null default '' ,
  60. add column company_name varchar(112) not null default '',
  61. add index (factory_name)
  62. alter table warehouse
  63. add column factory_code varchar(56) not null default '' ,
  64. add column factory_name varchar(56) not null default ''
  65. insert into warehouse (factory_code,factory_name,warehoseCode,warehosetName,enable)
  66. alter table warehouse add column pasture_name varchar(56) default ''
  67. add index (warehoseCode,warehosetName)
  68. drop index warehoseCode;
  69. alter table buydetail
  70. add column rowNumber INT default 0
  71. alter table contract
  72. modify id int(11) not null auto_increment
  73. delete from warehouse where warehoseCode <> ''
  74. show create table pasture;
  75. select contractId from partlaid order by contractId desc limit 1
  76. select * from contract where id =623930
  77. alter table equipment
  78. add unique index (eqcode)
  79. add column soncode varchar(50) default ''
  80. alter table department
  81. rename column CostCenter_code to costCenter_code
  82. add column pasturename varchar(100) default ''
  83. alter table temDict
  84. add CostCenter varchar(50) default '',
  85. add deptname varchar(50) default ''
  86. alter table parts add column old_partcode varchar(50) default '';
  87. alter table parts add index (old_partcode);
  88. alter table parts add unique index(partcode,name,specification) ;
  89. alter table parts add unique index(partcode) ;
  90. alter table parts drop index partCode ;
  91. alter table parts add column new_partcode varchar(50) default '';
  92. alter table parts add column isSave integer default 0;
  93. alter table parts add unique index (partcode) ;
  94. delete from parts where partcode like '14%'
  95. select count(id) from parts where partcode like '14%'
  96. -- count =31568
  97. alter table part_class add column pname varchar(50) default '';
  98. alter table part_class add column new_partcode varchar(50) default '';
  99. alter table BigPartTransfer add column deptId integer default 0;
  100. alter table BigPartTransfer add column sapStatus integer default 0;
  101. alter table BigPartTransfer add column sapText text default '';