# migration tests

FEATURE: migration 15a - alter field remove primaryKey -P
background:
 configure loadFKs = true
thenType: struct

# -- start chain ---
---
title: migration15a
chainNextTest:true
given:
 type Customer struct {id int primaryKey, wid int, height int} end

when:
  insert Customer {id: 1, wid:33, height:44}
  let x = Customer[1]
then:
value:a:Customer {
 vid:1
 vwid:33
 vheight:44
}

---
title: migration15a.1 - alter field 
#note. not really failing because of policy. simply not supported by most dbs
given:
 type Customer struct {id int, wid int, height int  } end

when:
  insert Customer {id:2, wid:34, height:45}
  let x = Customer[true].orderBy('id')
then:
ERROR: migration-failed-due-to-policy
}

