Revision ab7ad5d5

View differences:

src/onedb/fsck.rb
213 213

  
214 214

  
215 215

  
216
        @db.run "CREATE TABLE group_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
216
        @db.run "CREATE TABLE group_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
217 217

  
218 218
        @db.fetch("SELECT * from group_pool") do |row|
219 219
            gid = row[:oid]
......
394 394
        end
395 395

  
396 396

  
397
        @db.run "CREATE TABLE cluster_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
397
        @db.run "CREATE TABLE cluster_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
398 398

  
399 399
        @db.fetch("SELECT * from cluster_pool") do |row|
400 400
            cluster_id = row[:oid]
......
532 532
        end
533 533

  
534 534

  
535
        @db.run "CREATE TABLE datastore_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name));"
535
        @db.run "CREATE TABLE datastore_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name));"
536 536

  
537 537
        @db.fetch("SELECT * from datastore_pool") do |row|
538 538
            ds_id = row[:oid]
......
707 707

  
708 708
        # Create a new empty table where we will store the new calculated values
709 709
        @db.run "CREATE TABLE host_pool_new (oid INTEGER PRIMARY KEY, " <<
710
                "name VARCHAR(128), body TEXT, state INTEGER, " <<
710
                "name VARCHAR(128), body MEDIUMTEXT, state INTEGER, " <<
711 711
                "last_mon_time INTEGER, uid INTEGER, gid INTEGER, " <<
712 712
                "owner_u INTEGER, group_u INTEGER, other_u INTEGER, " <<
713 713
                "cid INTEGER, UNIQUE(name));"
......
793 793
        ########################################################################
794 794

  
795 795
        # Create a new empty table where we will store the new calculated values
796
        @db.run "CREATE TABLE image_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name,uid) );"
796
        @db.run "CREATE TABLE image_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name,uid) );"
797 797

  
798 798
        # Calculate the host's xml and write them to host_pool_new
799 799
        @db[:image_pool].each do |row|
......
918 918
        # LEASES
919 919
        ########################################################################
920 920

  
921
        @db.run "CREATE TABLE leases_new (oid INTEGER, ip BIGINT, body TEXT, PRIMARY KEY(oid,ip));"
921
        @db.run "CREATE TABLE leases_new (oid INTEGER, ip BIGINT, body MEDIUMTEXT, PRIMARY KEY(oid,ip));"
922 922

  
923 923
        @db[:leases].each do |row|
924 924
            doc = Document.new(row[:body])
......
1037 1037
        ########################################################################
1038 1038

  
1039 1039
        # Create a new empty table where we will store the new calculated values
1040
        @db.run "CREATE TABLE network_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name,uid));"
1040
        @db.run "CREATE TABLE network_pool_new (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, cid INTEGER, UNIQUE(name,uid));"
1041 1041

  
1042 1042
        @db[:network_pool].each do |row|
1043 1043
            doc = Document.new(row[:body])
......
1072 1072
        ########################################################################
1073 1073

  
1074 1074
        @db.run "ALTER TABLE user_pool RENAME TO old_user_pool;"
1075
        @db.run "CREATE TABLE user_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
1075
        @db.run "CREATE TABLE user_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
1076 1076

  
1077 1077
        # oneadmin does not have quotas
1078 1078
        @db.fetch("SELECT * FROM old_user_pool WHERE oid=0") do |row|
......
1105 1105
        ########################################################################
1106 1106

  
1107 1107
        @db.run "ALTER TABLE group_pool RENAME TO old_group_pool;"
1108
        @db.run "CREATE TABLE group_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
1108
        @db.run "CREATE TABLE group_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
1109 1109

  
1110 1110
        # oneadmin group does not have quotas
1111 1111
        @db.fetch("SELECT * FROM old_group_pool WHERE oid=0") do |row|

Also available in: Unified diff