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

0
db/development Normal file
View File

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

194
db/schema.rb Normal file
View File

@@ -0,0 +1,194 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130124223508) do
create_table "lva_translations", :force => true do |t|
t.integer "lva_id"
t.string "locale"
t.text "desc"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "lva_translations", ["locale"], :name => "index_lva_translations_on_locale"
add_index "lva_translations", ["lva_id"], :name => "index_lva_translations_on_lva_id"
create_table "lvas", :force => true do |t|
t.string "name"
t.text "desc"
t.decimal "ects"
t.string "lvanr"
t.decimal "stunden"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "modul_id"
end
create_table "lvas_moduls", :id => false, :force => true do |t|
t.integer "lva_id"
t.integer "modul_id"
end
create_table "modul_translations", :force => true do |t|
t.integer "modul_id"
t.string "locale"
t.text "desc"
t.text "depend"
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "modul_translations", ["locale"], :name => "index_modul_translations_on_locale"
add_index "modul_translations", ["modul_id"], :name => "index_modul_translations_on_modul_id"
create_table "modulgruppe_translations", :force => true do |t|
t.integer "modulgruppe_id"
t.string "locale"
t.text "desc"
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "modulgruppe_translations", ["locale"], :name => "index_modulgruppe_translations_on_locale"
add_index "modulgruppe_translations", ["modulgruppe_id"], :name => "index_modulgruppe_translations_on_modulgruppe_id"
create_table "modulgruppen", :force => true do |t|
t.string "typ"
t.integer "phase"
t.string "name"
t.text "desc"
t.integer "studium_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "modulgruppen_moduls", :id => false, :force => true do |t|
t.integer "modul_id"
t.integer "modulgruppe_id"
end
create_table "moduls", :force => true do |t|
t.string "name"
t.text "desc"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "depend"
t.integer "studium_id"
end
create_table "neuigkeiten", :force => true do |t|
t.string "title"
t.text "text"
t.datetime "datum"
t.integer "rubrik_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "roles", :force => true do |t|
t.string "name"
t.integer "resource_id"
t.string "resource_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "roles", ["name", "resource_type", "resource_id"], :name => "index_roles_on_name_and_resource_type_and_resource_id"
add_index "roles", ["name"], :name => "index_roles_on_name"
create_table "rubriken", :force => true do |t|
t.string "name"
t.text "desc"
t.integer "prio"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "semesters", :force => true do |t|
t.string "name"
t.integer "nummer"
t.boolean "ws"
t.boolean "ss"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "studien", :force => true do |t|
t.string "zahl"
t.string "name"
t.text "desc"
t.string "typ"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "studium_translations", :force => true do |t|
t.string "locale"
t.text "desc"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "studien_id"
end
add_index "studium_translations", ["locale"], :name => "index_studium_translations_on_locale"
create_table "users", :force => true do |t|
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
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"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.integer "failed_attempts", :default => 0
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
create_table "users_roles", :id => false, :force => true do |t|
t.integer "user_id"
t.integer "role_id"
end
add_index "users_roles", ["user_id", "role_id"], :name => "index_users_roles_on_user_id_and_role_id"
create_table "versions", :force => true 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"], :name => "index_versions_on_item_type_and_item_id"
end

7
db/seeds.rb Normal file
View File

@@ -0,0 +1,7 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)

BIN
db/sqlite3.exe Normal file

Binary file not shown.