Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table :users, :options => "AUTO_INCREMENT = 40000" do |t|
- t.string :usid, :limit => 15, :null => false
- t.string :password, :limit => 30, :null => false
- t.string :salt, :limit => 40
- t.string :name, :limit => 50, :null => false
- t.string :email, :limit => 30, :null => false
- t.string :room, :limit => 6, :null => false
- t.string :school, :limit => 5, :null => false
- t.integer :firewall, :null => false
- t.integer :order, :null => false
- t.timestamps
- end
- end
- def self.down
- drop_table :users
- end
- end
- class CreateGroups < ActiveRecord::Migration
- def self.up
- create_table :groups do |t|
- t.string :name
- t.timestamps
- end
- end
- def self.down
- drop_table :groups
- end
- end
- class CreateComputers < ActiveRecord::Migration
- def self.up
- create_table :computers do |t|
- t.integer :user_id
- t.string :mac, :limit => 18
- t.string :wmac, :limit => 18
- t.string :host, :limit => 20, :null => false
- t.string :password, :limit => 30, :null => false
- t.string :salt :limit => 30
- t.datetime :expire
- t.timestamps
- end
- end
- def self.down
- drop_table :computers
- end
- end
- class CreatePacis < ActiveRecord::Migration
- def self.up
- create_table :pacis do |t|
- t.integer :computer_id
- t.string :ip, :limit => 16, :null => false
- t.timestamps
- end
- end
- def self.down
- drop_table :pacis
- end
- end
- class CreateBans < ActiveRecord::Migration
- def self.up
- create_table :bans do |t|
- t.integer :computer_id
- t.string :reason, :limit => 100, :null => false
- t.datetime :starttime, :null => false
- t.datetime :endtime, :null => false
- end
- end
- def self.down
- drop_table :bans
- end
- end
- class CreateEbans < ActiveRecord::Migration
- def self.up
- create_table :ebans do |t|
- t.integer :paci_id
- t.string :reason, :limit => 100, :null => false
- t.datetime :starttime, :null => false
- t.datetime :endtime, :null => false
- end
- end
- def self.down
- drop_table :ebans
- end
- end
- class CreateTraffics < ActiveRecord::Migration
- def self.up
- create_table :traffics do |t|
- t.integer :computer_id
- t.string :ip, :limit => 16, :null => false
- t.datetime :time, :null => false
- t.integer :in_up, :null => false
- t.integer :in_down, :null => false
- t.integer :out_up, :null => false
- t.integer :out_down, :null => false
- t.integer :xdrop_up, :null => false
- t.integer :xdrop_down, :null => false
- end
- end
- def self.down
- drop_table :traffics
- end
- end
- class CreateMembers < ActiveRecord::Migration
- def self.up
- create_table :members do |t|
- t.integer :user_id
- t.integer :group_id
- end
- end
- def self.down
- drop_table :members
- end
- end
Add Comment
Please, Sign In to add comment