Projects STRLCPY dolt Commits 48df05c4
🤬
  • ■ ■ ■ ■ ■
    go/libraries/doltcore/migrate/transform.go
    skipped 106 lines
    107 107   return migrateInitCommit(ctx, oldCm, new, prog)
    108 108   }
    109 109   
    110  - prog.Log(ctx, "migrating commit %s", oldHash.String())
     110 + hs := oldHash.String()
     111 + prog.Log(ctx, "migrating commit %s", hs)
    111 112   
    112 113   oldRoot, err := oldCm.GetRootValue(ctx)
    113 114   if err != nil {
    skipped 588 lines
  • ■ ■ ■ ■ ■ ■
    go/libraries/doltcore/schema/schema.go
    skipped 147 lines
    148 148   if !colCollIsEqual {
    149 149   return false
    150 150   }
     151 + 
     152 + // Pks and Non-pks are in the same order as the key tuple and value tuple fields
     153 + if !ColCollsAreEqual(sch1.GetPKCols(), sch2.GetPKCols()) {
     154 + return false
     155 + }
     156 + 
     157 + if !ColCollsAreEqual(sch1.GetNonPKCols(), sch2.GetNonPKCols()) {
     158 + return false
     159 + }
     160 + 
    151 161   return sch1.Indexes().Equals(sch2.Indexes())
    152 162  }
    153 163   
    skipped 181 lines
  • ■ ■ ■ ■ ■ ■
    integration-tests/bats/migrate.bats
    skipped 302 lines
    303 303   [[ "$output" =~ "already migrated" ]] || false
    304 304  }
    305 305   
     306 +@test "migrate: changing primary key ordinals should migrate" {
     307 + dolt sql -q "create table t (col1 int, col2 int, col3 enum('a', 'b'), primary key (col1, col2, col3))"
     308 + dolt sql -q "insert into t values (1, 2, 'a'), (2, 3, 'b'), (3, 4, 'a');"
     309 + dolt commit -Am "initial"
     310 + 
     311 + dolt sql -q "alter table t drop primary key;"
     312 + dolt sql -q "alter table t add primary key (col3, col2, col1);"
     313 + dolt commit -am "change primary key order"
     314 + 
     315 + dolt sql -q "insert into t values (5, 6, 'b');"
     316 + dolt commit -am "add new row"
     317 + 
     318 + dolt migrate
     319 + run dolt sql -r csv -q "select * from t order by col1 asc;"
     320 + [ $status -eq 0 ]
     321 + [[ $output =~ "col1,col2,col3" ]]
     322 + [[ $output =~ "1,2,a" ]]
     323 + [[ $output =~ "2,3,b" ]]
     324 + [[ $output =~ "3,4,a" ]]
     325 + [[ $output =~ "5,6,b" ]]
     326 +}
     327 + 
Please wait...
Page is in error, reload to recover