forked from bofh/fetsite
GitHub Account angelegt
This commit is contained in:
15
db/migrate/20130112104517_create_lvas.rb
Normal file
15
db/migrate/20130112104517_create_lvas.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateLvas < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :lvas do |t|
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.decimal :ects
|
||||
t.string :lvanr
|
||||
t.decimal :stunden
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
def down
|
||||
drop_table :lvas
|
||||
end
|
||||
end
|
||||
11
db/migrate/20130112105754_create_moduls.rb
Normal file
11
db/migrate/20130112105754_create_moduls.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateModuls < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :moduls do |t|
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.text :depend
|
||||
t.timestamps
|
||||
end
|
||||
add_column :lvas, :modul_id, :integer
|
||||
end
|
||||
end
|
||||
12
db/migrate/20130112110800_create_semesters.rb
Normal file
12
db/migrate/20130112110800_create_semesters.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateSemesters < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :semesters do |t|
|
||||
t.string :name
|
||||
t.integer :nummer
|
||||
t.integer :studium_id
|
||||
t.string :ssws
|
||||
t.timestamps
|
||||
end
|
||||
add_column :lvas, :semester_id, :integer
|
||||
end
|
||||
end
|
||||
13
db/migrate/20130112144222_create_studien.rb
Normal file
13
db/migrate/20130112144222_create_studien.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateStudien < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :studien do |t|
|
||||
t.string :zahl
|
||||
t.string :name
|
||||
t.text :shortdesc
|
||||
t.text :desc
|
||||
t.string :typ
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
19
db/migrate/20130113160023_create_versions.rb
Normal file
19
db/migrate/20130113160023_create_versions.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreateVersions < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :versions do |t|
|
||||
t.string :item_type, :null => false
|
||||
t.integer :item_id, :null => false
|
||||
t.string :event, :null => false
|
||||
t.string :whodunnit
|
||||
t.text :object
|
||||
t.datetime :created_at
|
||||
t.integer :locale
|
||||
end
|
||||
add_index :versions, [:item_type, :item_id]
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_index :versions, [:item_type, :item_id]
|
||||
drop_table :versions
|
||||
end
|
||||
end
|
||||
46
db/migrate/20130113184409_devise_create_users.rb
Normal file
46
db/migrate/20130113184409_devise_create_users.rb
Normal file
@@ -0,0 +1,46 @@
|
||||
class DeviseCreateUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table(:users) do |t|
|
||||
## Database authenticatable
|
||||
t.string :email, :null => false, :default => ""
|
||||
t.string :encrypted_password, :null => false, :default => ""
|
||||
|
||||
## Recoverable
|
||||
t.string :reset_password_token
|
||||
t.datetime :reset_password_sent_at
|
||||
|
||||
## Rememberable
|
||||
t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
t.integer :sign_in_count, :default => 0
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
t.string :confirmation_token
|
||||
t.datetime :confirmed_at
|
||||
t.datetime :confirmation_sent_at
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
## Lockable
|
||||
t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
## Token authenticatable
|
||||
# t.string :authentication_token
|
||||
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :users, :email, :unique => true
|
||||
add_index :users, :reset_password_token, :unique => true
|
||||
add_index :users, :confirmation_token, :unique => true
|
||||
add_index :users, :unlock_token, :unique => true
|
||||
# add_index :users, :authentication_token, :unique => true
|
||||
end
|
||||
end
|
||||
19
db/migrate/20130113184604_rolify_create_roles.rb
Normal file
19
db/migrate/20130113184604_rolify_create_roles.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class RolifyCreateRoles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table(:roles) do |t|
|
||||
t.string :name
|
||||
t.references :resource, :polymorphic => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table(:users_roles, :id => false) do |t|
|
||||
t.references :user
|
||||
t.references :role
|
||||
end
|
||||
|
||||
add_index(:roles, :name)
|
||||
add_index(:roles, [ :name, :resource_type, :resource_id ])
|
||||
add_index(:users_roles, [ :user_id, :role_id ])
|
||||
end
|
||||
end
|
||||
17
db/migrate/20130115110100_translate_studien.rb
Normal file
17
db/migrate/20130115110100_translate_studien.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class TranslateStudien < ActiveRecord::Migration
|
||||
def self.up
|
||||
Studium.create_translation_table!({
|
||||
:desc => :text,
|
||||
:shortdesc => :text
|
||||
}, {
|
||||
#:migrate_data => true
|
||||
})
|
||||
add_column :studium_translations, :studien_id, :integer
|
||||
remove_column :studium_translations, :studium_id
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
Studium.drop_translation_table! #:migrate_data => true
|
||||
end
|
||||
end
|
||||
11
db/migrate/20130119152959_create_neuigkeiten.rb
Normal file
11
db/migrate/20130119152959_create_neuigkeiten.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateNeuigkeiten < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :neuigkeiten do |t|
|
||||
t.string :title
|
||||
t.text :text
|
||||
t.datetime :datum
|
||||
t.integer :rubrik_id
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
12
db/migrate/20130121073050_create_modulgruppen.rb
Normal file
12
db/migrate/20130121073050_create_modulgruppen.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateModulgruppen < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :modulgruppen do |t|
|
||||
t.string :typ
|
||||
t.integer :phase
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.integer :studium_id
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
class CreateModulgruppeModulJoinTable < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :modulgruppen_moduls, :id=>false do |t|
|
||||
t.integer :modul_id
|
||||
t.integer :modulgruppe_id
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/migrate/20130124000100_translate_modulgruppen.rb
Normal file
15
db/migrate/20130124000100_translate_modulgruppen.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class TranslateModulgruppen < ActiveRecord::Migration
|
||||
def self.up
|
||||
Modulgruppe.create_translation_table!({
|
||||
:desc => :text,
|
||||
:name => :string
|
||||
}, {
|
||||
:migrate_data => true
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
Modulgruppe.drop_translation_table! :migrate_data => true
|
||||
end
|
||||
end
|
||||
17
db/migrate/20130124000200_translate_moduls.rb
Normal file
17
db/migrate/20130124000200_translate_moduls.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class TranslateModuls < ActiveRecord::Migration
|
||||
def self.up
|
||||
Modul.create_translation_table!({
|
||||
:desc => :text,
|
||||
:depend => :text,
|
||||
:name => :string
|
||||
}, {
|
||||
#:migrate_data => true
|
||||
})
|
||||
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
Modul.drop_translation_table! #:migrate_data => true
|
||||
end
|
||||
end
|
||||
15
db/migrate/20130124000300_translate_lvas.rb
Normal file
15
db/migrate/20130124000300_translate_lvas.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class TranslateLvas < ActiveRecord::Migration
|
||||
def self.up
|
||||
Lva.create_translation_table!({
|
||||
:desc => :text
|
||||
}, {
|
||||
#:migrate_data => true
|
||||
})
|
||||
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
Lva.drop_translation_table! #:migrate_data => true
|
||||
end
|
||||
end
|
||||
8
db/migrate/20130124010100_create_lva_modul_join_table.rb
Normal file
8
db/migrate/20130124010100_create_lva_modul_join_table.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class CreateLvaModulJoinTable < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :lvas_moduls, :id=>false do |t|
|
||||
t.integer :lva_id
|
||||
t.integer :modul_id
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20130124223508_create_rubriken.rb
Normal file
11
db/migrate/20130124223508_create_rubriken.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateRubriken < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :rubriken do |t|
|
||||
t.string :name
|
||||
t.text :desc
|
||||
t.integer :prio
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user