Skip to content

Commit 62735b1

Browse files
committed
add migrations
1 parent 74f3086 commit 62735b1

23 files changed

Lines changed: 446 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20180626151505)
4+
class AddConferences < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences do |t|
7+
t.jsonb :title, null: false
8+
t.jsonb :slogan, null: false
9+
t.string :slug, null: false
10+
t.string :hashtag
11+
t.string :reference
12+
t.string :location
13+
t.integer :decidim_organization_id,
14+
foreign_key: true,
15+
index: { name: "index_decidim_conferences_on_decidim_organization_id" }
16+
17+
t.jsonb :short_description, null: false
18+
t.jsonb :description, null: false
19+
t.string :hero_image
20+
t.string :banner_image
21+
t.boolean :promoted, default: false
22+
t.datetime :published_at
23+
t.jsonb :objectives, null: false
24+
t.boolean :show_statistics, default: false
25+
t.date :start_date
26+
t.date :end_date
27+
t.boolean :scopes_enabled, null: false, default: true
28+
t.integer :decidim_scope_id
29+
30+
t.boolean :registrations_enabled, null: false, default: false
31+
t.integer :available_slots, null: false, default: 0
32+
t.jsonb :registration_terms
33+
34+
t.index [:decidim_organization_id, :slug],
35+
name: "index_unique_conference_slug_and_organization",
36+
unique: true
37+
38+
t.timestamps
39+
end
40+
end
41+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20180626152015)
4+
class AddConferenceUserRoles < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conference_user_roles do |t|
7+
t.integer :decidim_user_id
8+
t.integer :decidim_conference_id
9+
t.string :role
10+
t.timestamps
11+
end
12+
13+
add_index :decidim_conference_user_roles,
14+
[:decidim_conference_id, :decidim_user_id, :role],
15+
unique: true,
16+
name: "index_unique_user_and_conference_role"
17+
end
18+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20180702084256)
4+
class AddConferenceSpeakers < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conference_speakers do |t|
7+
t.references :decidim_conference, index: true
8+
t.string :full_name
9+
t.jsonb :position
10+
t.jsonb :affiliation
11+
t.string :twitter_handle
12+
t.jsonb :short_bio
13+
t.string :personal_url
14+
t.string :avatar
15+
t.references :decidim_user, index: { name: "index_decidim_conference_speaker_on_decidim_user_id" }
16+
17+
t.timestamps
18+
end
19+
end
20+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20180706104306)
4+
class AddConferenceInvites < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences_conference_invites do |t|
7+
t.references :decidim_user, null: false, index: true
8+
t.references :decidim_conference, null: false,
9+
index: { name: "idx_decidim_conferences_invites_on_conference_id" }
10+
t.datetime :sent_at
11+
t.datetime :accepted_at
12+
t.datetime :rejected_at
13+
14+
t.timestamps
15+
end
16+
end
17+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20180706104825)
4+
class AddConferenceRegistrations < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences_conference_registrations do |t|
7+
t.references :decidim_user, null: false, index: { name: "index_decidim_conferences_registrations_on_decidim_user_id" }
8+
t.references :decidim_conference, null: false, index: { name: "index_conferences_registrations_on_decidim_conference" }
9+
10+
t.timestamps
11+
end
12+
13+
add_index :decidim_conferences_conference_registrations,
14+
[:decidim_user_id, :decidim_conference_id],
15+
unique: true,
16+
name: "decidim_conferences_registrations_user_conference_unique"
17+
end
18+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20181004144411)
4+
class AddConferencesPartner < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences_partners do |t|
7+
t.references :decidim_conference, index: true
8+
t.string :name, null: false
9+
t.string :partner_type, null: false
10+
t.integer :weight, null: false, default: 0
11+
t.string :link
12+
t.string :logo, null: false
13+
14+
t.timestamps
15+
end
16+
17+
add_index :decidim_conferences_partners, [:weight, :partner_type]
18+
end
19+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20181010133930)
4+
class AddRelationBetweenSpeakerAndMeeting < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conference_speaker_conference_meetings do |t|
7+
t.belongs_to :conference_speaker, null: false, index: { name: "index_meetings_on_decidim_conference_speaker_id" }
8+
t.belongs_to :conference_meeting, null: false, index: { name: "index_meetings_on_decidim_conference_meeting_id" }
9+
end
10+
end
11+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20181015100301)
4+
class AddConferenceMediaLink < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences_media_links do |t|
7+
t.references :decidim_conference, index: true
8+
t.jsonb :title, null: false
9+
t.string :link, null: false
10+
t.date :date
11+
t.integer :weight, null: false, default: 0
12+
13+
t.timestamps
14+
end
15+
end
16+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20181023142325)
4+
class AddConferenceRegistrationTypes < ActiveRecord::Migration[5.2]
5+
def change
6+
create_table :decidim_conferences_registration_types do |t|
7+
t.references :decidim_conference, index: { name: "idx_registration_types_on_decidim_conference_id" }
8+
t.jsonb :title, null: false
9+
t.jsonb :description, null: false
10+
t.decimal :price, null: false, default: 0, precision: 8, scale: 2
11+
t.integer :weight, null: false, default: 0
12+
t.datetime :published_at, index: true
13+
14+
t.timestamps
15+
end
16+
17+
create_table :decidim_conferences_conference_meeting_registration_types do |t|
18+
t.belongs_to :registration_type, null: false, index: { name: "index_meetings_on_decidim_registration_type_id" }
19+
t.belongs_to :conference_meeting, null: false, index: { name: "index_registrations_on_decidim_conference_meeting_id" }
20+
end
21+
end
22+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# This migration comes from decidim_conferences (originally 20181030090202)
4+
class AddReferenceRegistrationTypeToConferenceRegistration < ActiveRecord::Migration[5.2]
5+
def change
6+
add_column :decidim_conferences_conference_registrations, :decidim_conference_registration_type_id,
7+
:integer, index: { name: "idx_conference_registration_to_registration_type_id" }
8+
add_column :decidim_conferences_conference_registrations, :confirmed_at, :datetime, index: true
9+
end
10+
end

0 commit comments

Comments
 (0)