Permalink
Browse files

Added migration for SupportedSharingService.

  • Loading branch information...
1 parent 532f8c0 commit 67b4a5eb113d96ec82201cea9af02da10048e91a @benubois benubois committed May 6, 2014
Showing with 78 additions and 0 deletions.
  1. +13 −0 db/migrate/20140416025157_create_supported_sharing_services.rb
  2. +65 −0 db/structure.sql
View
13 db/migrate/20140416025157_create_supported_sharing_services.rb
@@ -0,0 +1,13 @@
+class CreateSupportedSharingServices < ActiveRecord::Migration
+ def change
+ create_table :supported_sharing_services do |t|
+ t.belongs_to :user, index: true, null: false
+ t.string :service_id, null: false
+ t.hstore :settings
+ t.json :service_options
+
+ t.timestamps
+ end
+ add_index :supported_sharing_services, [:user_id, :service_id], unique: true
+ end
+end
View
65 db/structure.sql
@@ -587,6 +587,40 @@ ALTER SEQUENCE subscriptions_id_seq OWNED BY subscriptions.id;
--
+-- Name: supported_sharing_services; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE supported_sharing_services (
+ id integer NOT NULL,
+ user_id integer NOT NULL,
+ service_id character varying(255) NOT NULL,
+ settings hstore,
+ service_options json,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone
+);
+
+
+--
+-- Name: supported_sharing_services_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE supported_sharing_services_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: supported_sharing_services_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE supported_sharing_services_id_seq OWNED BY supported_sharing_services.id;
+
+
+--
-- Name: taggings; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
@@ -838,6 +872,13 @@ ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscription
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
+ALTER TABLE ONLY supported_sharing_services ALTER COLUMN id SET DEFAULT nextval('supported_sharing_services_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
ALTER TABLE ONLY taggings ALTER COLUMN id SET DEFAULT nextval('taggings_id_seq'::regclass);
@@ -983,6 +1024,14 @@ ALTER TABLE ONLY subscriptions
--
+-- Name: supported_sharing_services_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY supported_sharing_services
+ ADD CONSTRAINT supported_sharing_services_pkey PRIMARY KEY (id);
+
+
+--
-- Name: taggings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
@@ -1197,6 +1246,20 @@ CREATE UNIQUE INDEX index_subscriptions_on_user_id_and_feed_id ON subscriptions
--
+-- Name: index_supported_sharing_services_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_supported_sharing_services_on_user_id ON supported_sharing_services USING btree (user_id);
+
+
+--
+-- Name: index_supported_sharing_services_on_user_id_and_service_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_supported_sharing_services_on_user_id_and_service_id ON supported_sharing_services USING btree (user_id, service_id);
+
+
+--
-- Name: index_taggings_on_tag_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -1533,4 +1596,6 @@ INSERT INTO schema_migrations (version) VALUES ('20140321203637');
INSERT INTO schema_migrations (version) VALUES ('20140326173619');
+INSERT INTO schema_migrations (version) VALUES ('20140416025157');
+
INSERT INTO schema_migrations (version) VALUES ('20140505062817');

0 comments on commit 67b4a5e

Please sign in to comment.