Browse Source

Database changes

Maarten van den Berg 8 years ago
parent
commit
3bf071a5c9
3 changed files with 54 additions and 2 deletions
  1. 5 0
      db/migrate/20161214112504_remove_group_type_from_groups.rb
  2. 1 2
      db/schema.rb
  3. 48 0
      db/seeds.rb

+ 5 - 0
db/migrate/20161214112504_remove_group_type_from_groups.rb

1
+class RemoveGroupTypeFromGroups < ActiveRecord::Migration[5.0]
2
+  def change
3
+    remove_column :groups, :type
4
+  end
5
+end

+ 1 - 2
db/schema.rb

10
 #
10
 #
11
 # It's strongly recommended that you check this file into your version control system.
11
 # It's strongly recommended that you check this file into your version control system.
12
 
12
 
13
-ActiveRecord::Schema.define(version: 20161212211342) do
13
+ActiveRecord::Schema.define(version: 20161214112504) do
14
 
14
 
15
   create_table "activities", force: :cascade do |t|
15
   create_table "activities", force: :cascade do |t|
16
     t.string   "public_name"
16
     t.string   "public_name"
29
 
29
 
30
   create_table "groups", force: :cascade do |t|
30
   create_table "groups", force: :cascade do |t|
31
     t.string   "name"
31
     t.string   "name"
32
-    t.string   "type"
33
     t.datetime "created_at", null: false
32
     t.datetime "created_at", null: false
34
     t.datetime "updated_at", null: false
33
     t.datetime "updated_at", null: false
35
   end
34
   end

+ 48 - 0
db/seeds.rb

15
   is_admin: true
15
   is_admin: true
16
 )
16
 )
17
 
17
 
18
+p2 = Person.create!(
19
+  first_name: 'Henkie',
20
+  last_name: 'Gekke',
21
+  birth_date: (Date.new 2016, 1, 1),
22
+  email: 'geefmijgeld@maartenberg.nl.eu.org'
23
+)
24
+
18
 u = User.create!(
25
 u = User.create!(
19
   email: 'maarten@maartenberg.nl.eu.org',
26
   email: 'maarten@maartenberg.nl.eu.org',
20
   person: p,
27
   person: p,
21
   password: 'damena123',
28
   password: 'damena123',
22
   password_confirmation: 'damena123'
29
   password_confirmation: 'damena123'
23
 )
30
 )
31
+
32
+g = Group.create!(
33
+  name: 'Teststam'
34
+)
35
+
36
+a = Activity.create!(
37
+  public_name: 'Fikkie stoken ofzo',
38
+  secret_name: 'Bosbrandopkomst',
39
+  description: 'Een scout trekt er samen met anderen op uit',
40
+  location: 'In het bos in het bos',
41
+  start: 4.weeks.since,
42
+  end: 4.weeks.since + 2.hours,
43
+  deadline: 3.weeks.since,
44
+  show_hidden: false,
45
+  group: g
46
+)
47
+
48
+Member.create!(
49
+  group: g,
50
+  person: p,
51
+  is_leader: true
52
+)
53
+Member.create!(
54
+  group: g,
55
+  person: p2
56
+)
57
+
58
+Participant.create!(
59
+  activity: a,
60
+  person: p,
61
+  is_organizer: true,
62
+  attending: true,
63
+  notes: nil
64
+)
65
+Participant.create!(
66
+  activity: a,
67
+  person: p2,
68
+  is_organizer: false,
69
+  attending: false,
70
+  notes: 'fliep floep'
71
+)