a.sql 5.0 KB

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