GitHub Account angelegt

This commit is contained in:
Andreas Stephanides
2013-02-12 02:05:12 +01:00
commit 3d11400d5e
216 changed files with 5031 additions and 0 deletions

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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