equal
deleted
inserted
replaced
48 cursor.execute(dbh.sql_create_numrange('entities_id_seq')) |
48 cursor.execute(dbh.sql_create_numrange('entities_id_seq')) |
49 cursor.execute(dbh.sql_restart_numrange('entities_id_seq', initial_value=lasteid)) |
49 cursor.execute(dbh.sql_restart_numrange('entities_id_seq', initial_value=lasteid)) |
50 session.commit() |
50 session.commit() |
51 |
51 |
52 if applcubicwebversion < (3, 19, 0) and cubicwebversion >= (3, 19, 0): |
52 if applcubicwebversion < (3, 19, 0) and cubicwebversion >= (3, 19, 0): |
53 sql('ALTER TABLE "entities" DROP COLUMN "mtime"') |
53 try: |
54 sql('ALTER TABLE "entities" DROP COLUMN "source"') |
54 # need explicit drop of the indexes on some database systems (sqlserver) |
|
55 sql(repo.system_source.dbhelper.sql_drop_index('entities', 'mtime')) |
|
56 sql('ALTER TABLE "entities" DROP COLUMN "mtime"') |
|
57 sql('ALTER TABLE "entities" DROP COLUMN "source"') |
|
58 except: # programming error, already migrated |
|
59 print "Failed to drop mtime or source database columns" |
|
60 print "'entities' table of the database has probably been already updated" |
55 |
61 |
56 commit() |
62 commit() |
57 |
63 |
58 replace_eid_sequence_with_eid_numrange(session) |
64 replace_eid_sequence_with_eid_numrange(session) |
59 |
65 |