fix indentation problems in bootstrap_migration (use 4 spaces instead of 3)
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 24 Jul 2009 09:28:59 +0200
changeset 2462 9e670072884d
parent 2461 1f38b65cbd20
child 2463 5200c0f7d2d5
fix indentation problems in bootstrap_migration (use 4 spaces instead of 3)
misc/migration/bootstrapmigration_repository.py
server/schemahooks.py
--- a/misc/migration/bootstrapmigration_repository.py	Fri Jul 24 09:25:15 2009 +0200
+++ b/misc/migration/bootstrapmigration_repository.py	Fri Jul 24 09:28:59 2009 +0200
@@ -11,48 +11,47 @@
 applcubicwebversion, cubicwebversion = versions_map['cubicweb']
 
 if applcubicwebversion < (3, 2, 2) and cubicwebversion >= (3, 2, 1):
-   from base64 import b64encode
-   for table in ('entities', 'deleted_entities'):
-      for eid, extid in sql('SELECT eid, extid FROM %s WHERE extid is NOT NULL'
-                            % table, ask_confirm=False):
-         sql('UPDATE %s SET extid=%%(extid)s WHERE eid=%%(eid)s' % table,
-             {'extid': b64encode(extid), 'eid': eid}, ask_confirm=False)
-   checkpoint()
+    from base64 import b64encode
+    for table in ('entities', 'deleted_entities'):
+        for eid, extid in sql('SELECT eid, extid FROM %s WHERE extid is NOT NULL'
+                              % table, ask_confirm=False):
+            sql('UPDATE %s SET extid=%%(extid)s WHERE eid=%%(eid)s' % table,
+                {'extid': b64encode(extid), 'eid': eid}, ask_confirm=False)
+    checkpoint()
 
 if applcubicwebversion < (3, 2, 0) and cubicwebversion >= (3, 2, 0):
-   add_cube('card', update_database=False)
+    add_cube('card', update_database=False)
 
 if applcubicwebversion < (2, 47, 0) and cubicwebversion >= (2, 47, 0):
-    from cubicweb.server import schemaserial
-    schemaserial.HAS_FULLTEXT_CONTAINER = False
-    session.set_shared_data('do-not-insert-is_instance_of', True)
-    add_attribute('CWRType', 'fulltext_container')
-    schemaserial.HAS_FULLTEXT_CONTAINER = True
+     from cubicweb.server import schemaserial
+     schemaserial.HAS_FULLTEXT_CONTAINER = False
+     session.set_shared_data('do-not-insert-is_instance_of', True)
+     add_attribute('CWRType', 'fulltext_container')
+     schemaserial.HAS_FULLTEXT_CONTAINER = True
 
 
 
 if applcubicwebversion < (2, 50, 0) and cubicwebversion >= (2, 50, 0):
-    session.set_shared_data('do-not-insert-is_instance_of', True)
-    add_relation_type('is_instance_of')
-    # fill the relation using an efficient sql query instead of using rql
-    sql('INSERT INTO is_instance_of_relation '
-        '  SELECT * from is_relation')
-    checkpoint()
-    session.set_shared_data('do-not-insert-is_instance_of', False)
+     session.set_shared_data('do-not-insert-is_instance_of', True)
+     add_relation_type('is_instance_of')
+     # fill the relation using an efficient sql query instead of using rql
+     sql('INSERT INTO is_instance_of_relation '
+         '  SELECT * from is_relation')
+     checkpoint()
+     session.set_shared_data('do-not-insert-is_instance_of', False)
 
 if applcubicwebversion < (2, 42, 0) and cubicwebversion >= (2, 42, 0):
-    sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP')
-    sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP')
-    sql('CREATE INDEX entities_mtime_idx ON entities(mtime)')
-    sql('''CREATE TABLE deleted_entities (
+     sql('ALTER TABLE entities ADD COLUMN mtime TIMESTAMP')
+     sql('UPDATE entities SET mtime=CURRENT_TIMESTAMP')
+     sql('CREATE INDEX entities_mtime_idx ON entities(mtime)')
+     sql('''CREATE TABLE deleted_entities (
   eid INTEGER PRIMARY KEY NOT NULL,
   type VARCHAR(64) NOT NULL,
   source VARCHAR(64) NOT NULL,
   dtime TIMESTAMP NOT NULL,
   extid VARCHAR(256)
 )''')
-    sql('CREATE INDEX deleted_entities_type_idx ON deleted_entities(type)')
-    sql('CREATE INDEX deleted_entities_dtime_idx ON deleted_entities(dtime)')
-    sql('CREATE INDEX deleted_entities_extid_idx ON deleted_entities(extid)')
-    checkpoint()
-
+     sql('CREATE INDEX deleted_entities_type_idx ON deleted_entities(type)')
+     sql('CREATE INDEX deleted_entities_dtime_idx ON deleted_entities(dtime)')
+     sql('CREATE INDEX deleted_entities_extid_idx ON deleted_entities(extid)')
+     checkpoint()
--- a/server/schemahooks.py	Fri Jul 24 09:25:15 2009 +0200
+++ b/server/schemahooks.py	Fri Jul 24 09:28:59 2009 +0200
@@ -21,7 +21,7 @@
 from cubicweb.server.sqlutils import SQL_PREFIX
 from cubicweb.server.pool import Operation, SingleLastOperation, PreCommitOperation
 from cubicweb.server.hookhelper import (entity_attr, entity_name,
-                                     check_internal_entity)
+                                        check_internal_entity)
 
 # core entity and relation types which can't be removed
 CORE_ETYPES = list(BASE_TYPES) + ['CWEType', 'CWRType', 'CWUser', 'CWGroup',