Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/models/app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class App

def self.organization
# TODO: generalize this to support switching orgs per configuration or per request.
"wingolf"
end

# Using this namespace, the organization can overwrite classes, locales, etc.
#
def self.code_namespace
organization
end

def self.database_namespace
# TODO: Unify this with our database namespacing mechanism, which also concerns the environment, possibly subdomain, etc.
end

end
20 changes: 20 additions & 0 deletions db/migrate/20120406225409_create_profiles.your_platform.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
class CreateProfiles < ActiveRecord::Migration[4.2]
#def change
# create_table :profiles do |t|
#
# t.timestamps
# end
#end

# Brauche ich hier wirklich eine eigene Tabelle?
# Was soll die denn tun, außer Benutzer und Profilfelder zu verknüpfen?
# Dazu brauche ich keine eigene Tabelle. Es könnte einfach beim Profilfeld eine user_id gepspeichert bleiben,
# wie es jetzt schon ist.
# Die Frage ist, ob in dieser Datenbank noch etwas anderes gespeichert wird pro Benutzer.

# Im Moment sieht es nicht so aus, als bräuchte ich eine eigene Tabelle.
# Daher ist hier alles auskommentiert.
# -- SF 2012-04-11

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateRelationshipDagLinks < ActiveRecord::Migration[4.2]
def change
create_table :relationship_dag_links do |t|
t.integer :ancestor_id
t.string :ancestor_type
t.integer :descendant_id
t.string :descendant_type
t.boolean :direct
t.integer :count

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreateRelationships < ActiveRecord::Migration[4.2]
def change
create_table :relationships do |t|
t.string :name

t.timestamps
end
end
end
10 changes: 10 additions & 0 deletions db/migrate/20120506073852_create_bv_mappings.wingolf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateBvMappings < ActiveRecord::Migration[4.2]
def change
create_table :bv_mappings do |t|
t.string :bv_name
t.string :plz

t.timestamps
end
end
end
11 changes: 0 additions & 11 deletions db/migrate/20120507165551_make_profile_fields_polymorphic.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class MakeProfileFieldsPolymorphic < ActiveRecord::Migration[4.2]

def change
change_table :profile_fields do |t|
# t.references :profileable, polymorphic: true
t.rename :user_id, :profileable_id
t.string :profileable_type
end

# 2021-03-21: For fresh installs, this is not needed anymore.
#
# # ProfileField.reset_column_information
# # ProfileField.all.each do |pf|
# # pf.profileable_type = "User" # Before that point in the migration chain, only users had profile_fields.
# # pf.save
# # end
end

end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20120811140509)
class CreateFlags < ActiveRecord::Migration[4.2]
def change
create_table :flags do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20120814100529)
class CreateAttachments < ActiveRecord::Migration[4.2]
def change
create_table :attachments do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20120815205610)
class AddContentTypeAndFileSizeToAttachments < ActiveRecord::Migration[4.2]
def change
add_column :attachments, :content_type, :string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class AddSlimMenuAttributeToRootPage < ActiveRecord::Migration[4.2]
def up

# This is not needed for fresh installs anymore.
#
# # # Add slim_menu attribute to the root page entry (wingolf.org).
# # if Page.find_root
# # nav_node = Page.find_root.nav_node
# # nav_node.slim_menu = true
# # nav_node.save
# # end

end
def down

# This is not needed for fresh installs anymore.
#
# # if Page.find_root
# # nav_node = Page.find_root.nav_node
# # nav_node.slim_menu = false
# # nav_node.save
# # end

end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class ModifyProfileFieldTypeColumn < ActiveRecord::Migration[4.2]
def up
# This is not needed for fresh installs anymore.
#
# # ProfileField.all.each do |pf|
# # pf.update_attributes( type: "ProfileFieldTypes::#{pf.type}" ) if not pf.type.include?( "::" ) if pf.type
# # end
end

def down
# This is not needed for fresh installs anymore.
#
# # ProfileField.all.each do |pf|
# # pf.update_attributes( type: pf.type.gsub( "ProfileFieldTypes::", "" ) ) if pf.type
# # end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class DropOldRelationshipTable < ActiveRecord::Migration[4.2]
def up
drop_table :relationships
end

def down
create_table :relationships do |t|
t.string :name
t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130118220014)
class AddRelationshipsTableWithoutDag < ActiveRecord::Migration[4.2]
def change
create_table :relationships do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class DropRelationshipDagLinkTable < ActiveRecord::Migration[4.2]
def change
drop_table :relationship_dag_links
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130207214331)
class CreateEvents < ActiveRecord::Migration[4.2]
def change
create_table :events do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130208215253)
class CreateStatusGroupMembershipInfos < ActiveRecord::Migration[4.2]
def change
create_table :status_group_membership_infos do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130220184943)
class CreateStars < ActiveRecord::Migration[4.2]
def change
create_table :stars do |t|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ def self.up
change_table(:user_accounts) do |t|
## Database authenticatable
#t.string :email, :null => false, :default => ""
if Rails.version.starts_with?("3")
t.string :encrypted_password, :null => false, :default => ""
else
# https://github.com/fiedl/wingolfsplattform/commit/01f7d3182387aaca99564216661bb7b222fee084#diff-e7267e28ca9cf34b8ba67e6b088344caR5
# http://stackoverflow.com/a/12990129/2066546
t.change :encrypted_password, :string, null: false, default: ""
end
t.change :encrypted_password, :string, :null => false, :default => ""

## Recoverable
t.string :reset_password_token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130310003840)
class RenameStarsToBookmarks < ActiveRecord::Migration[4.2]
def up
rename_table :stars, :bookmarks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130310004622)
class FixColumnNamesForBookmarks < ActiveRecord::Migration[4.2]
def change
rename_column :bookmarks, :starrable_id, :bookmarkable_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130313211414)
class CreateGeoInfos < ActiveRecord::Migration[4.2]
def change
create_table :geo_infos do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130313234131)
class CreateGeoLocations < ActiveRecord::Migration[4.2]
def change
create_table :geo_locations do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130314011638)
class DropGeoInfos < ActiveRecord::Migration[4.2]
def change
drop_table :geo_infos
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130315072759)
class AddInvalidToGeoLocation < ActiveRecord::Migration[4.2]
def change
add_column :geo_locations, :invalid, :boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130315073149)
class ExchangeInvalidForQueriedAtInGeoLocation < ActiveRecord::Migration[4.2]
def change
change_table :geo_locations do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130320003051)
class AddRedirectToToPage < ActiveRecord::Migration[4.2]
def change
add_column :pages, :redirect_to, :string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddRedirectionsForSpecialPages < ActiveRecord::Migration[4.2]
def up
# This is not needed for fresh installs anymore.
#
# # if Page.find_root && Page.find_intranet_root
# # Page.find_root.update_attributes( :redirect_to => "http://wingolf.org" )
# # Page.find_intranet_root.update_attributes( :redirect_to => "root#index" )
# # end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130329231657)
class CreatePosts < ActiveRecord::Migration[4.2]
def change
create_table :posts do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130404223735)
class AddEntireMessageToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :entire_message, :text
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130409192959)
class AddAuthorToPage < ActiveRecord::Migration[4.2]
def change
add_column :pages, :author_user_id, :integer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20130908011215)
class AddTypeToPages < ActiveRecord::Migration[4.2]
def change
add_column :pages, :type, :string
Expand Down
16 changes: 0 additions & 16 deletions db/migrate/20131115114715_validity_range_for_dag_links.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This migration comes from your_platform (originally 20131115114715)
class ValidityRangeForDagLinks < ActiveRecord::Migration[4.2]
def up
change_table :dag_links do |t|
t.rename :deleted_at, :valid_to
t.datetime :valid_from
# This is not needed for fresh installs anymore.
#
# # DagLink.connection.execute "UPDATE `dag_links` SET `valid_from`=`created_at` WHERE 1"
end
end
def down
change_table :dag_links do |t|
t.rename :valid_to, :deleted_at

# This is not needed for fresh installs anymore.
#
# # DagLink.connection.execute "UPDATE `dag_links` SET `created_at`=`valid_from` WHERE `valid_from` IS NOT NULL"

t.remove_column :valid_from
end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20140611170430)
# Migration responsible for creating a table with activities
class CreateActivities < ActiveRecord::Migration[4.2]
# Create table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141008101744)
class AddLocationToEvents < ActiveRecord::Migration[4.2]
def change
add_column :events, :location, :string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141010130344)
class AddPublishOnWebsiteToEvents < ActiveRecord::Migration[4.2]
def change
add_column :events, :publish_on_global_website, :boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141010134227)
class AddAuthTokenToUserAccounts < ActiveRecord::Migration[4.2]
def change
add_column :user_accounts, :auth_token, :string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141018143323)
class AddAcceptedTermsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :accepted_terms, :string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141018221659)
class AddAuthorToAttachments < ActiveRecord::Migration[4.2]
def change
add_column :attachments, :author_user_id, :integer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141102223954)
class AddBodyToGroups < ActiveRecord::Migration[4.2]
def change
add_column :groups, :body, :text
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20141110193830)
class CreateSettings < ActiveRecord::Migration[4.2]
def self.up
create_table :settings do |t|
Expand Down
6 changes: 0 additions & 6 deletions db/migrate/20141202140522_add_indices.rb

This file was deleted.

6 changes: 6 additions & 0 deletions db/migrate/20141202140522_add_indices.your_platform.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddIndices < ActiveRecord::Migration[4.2]
def change
add_index 'dag_links', [:ancestor_id, :ancestor_type, :direct], name: 'dag_ancestor', order: { id: :asc }
add_index 'dag_links', [:descendant_id, :descendant_type], name: 'dag_descendant', order: { id: :asc }
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This migration comes from your_platform (originally 20150127013809)
class AddIncognitoToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :incognito, :boolean
Expand Down
Loading