moved_entities.extid may not be NULL
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 29 Sep 2015 15:49:10 +0200
changeset 10627 ffef8ac383f4
parent 10626 93f8d239c708
child 10628 8f32cdc3f4ec
moved_entities.extid may not be NULL
misc/migration/3.21.2_Any.py
server/sources/native.py
--- a/misc/migration/3.21.2_Any.py	Tue Sep 29 15:15:03 2015 +0200
+++ b/misc/migration/3.21.2_Any.py	Tue Sep 29 15:49:10 2015 +0200
@@ -1,1 +1,7 @@
 sync_schema_props_perms('cwuri')
+
+helper = repo.system_source.dbhelper
+cu = session.cnxset.cu
+helper.set_null_allowed(cu, 'moved_entities', 'extid', 'VARCHAR(256)', False)
+
+commit()
--- a/server/sources/native.py	Tue Sep 29 15:15:03 2015 +0200
+++ b/server/sources/native.py	Tue Sep 29 15:49:10 2015 +0200
@@ -1405,7 +1405,7 @@
 CREATE INDEX entities_type_idx ON entities(type);;
 CREATE TABLE moved_entities (
   eid INTEGER PRIMARY KEY NOT NULL,
-  extid VARCHAR(256) UNIQUE
+  extid VARCHAR(256) UNIQUE NOT NULL
 );;
 
 CREATE TABLE transactions (