initial sofurry impl
This commit is contained in:
29
db/migrate/20250628000003_create_sofurry_types.rb
Normal file
29
db/migrate/20250628000003_create_sofurry_types.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
class CreateSofurryTypes < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
up_only { execute "SET DEFAULT_TABLESPACE = mirai" }
|
||||
|
||||
add_json_index(
|
||||
:domain_users,
|
||||
:sofurry_id,
|
||||
:integer,
|
||||
where: "type = 'Domain::User::SofurryUser'",
|
||||
unique: true,
|
||||
)
|
||||
|
||||
add_json_index(
|
||||
:domain_users,
|
||||
:url_name,
|
||||
:text,
|
||||
where: "type = 'Domain::User::SofurryUser'",
|
||||
unique: true,
|
||||
)
|
||||
|
||||
add_json_index(
|
||||
:domain_posts,
|
||||
:sofurry_id,
|
||||
:integer,
|
||||
where: "type = 'Domain::Post::SofurryPost'",
|
||||
unique: true,
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -5824,6 +5824,13 @@ CREATE INDEX idx_domain_post_files_on_url_str_lower ON public.domain_post_files
|
||||
CREATE INDEX idx_domain_post_files_on_url_str_lower_reverse ON public.domain_post_files USING btree (reverse(lower((json_attributes ->> 'url_str'::text))) text_pattern_ops);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_posts_on_sofurry_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
|
||||
--
|
||||
|
||||
CREATE UNIQUE INDEX idx_domain_posts_on_sofurry_id ON public.domain_posts USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::Post::SofurryPost'::public.domain_post_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_users_e621_on_name_lower; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
|
||||
--
|
||||
@@ -5845,6 +5852,20 @@ CREATE INDEX idx_domain_users_inkbunny_on_name_lower ON public.domain_users USIN
|
||||
CREATE INDEX idx_domain_users_on_migrated_user_favs_at ON public.domain_users USING btree (((json_attributes ->> 'migrated_user_favs_at'::text)));
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_users_on_sofurry_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
|
||||
--
|
||||
|
||||
CREATE UNIQUE INDEX idx_domain_users_on_sofurry_id ON public.domain_users USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::User::SofurryUser'::public.domain_user_type);
|
||||
|
||||
|
||||
--
|
||||
-- Name: idx_domain_users_on_url_name; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai
|
||||
--
|
||||
|
||||
CREATE UNIQUE INDEX idx_domain_users_on_url_name ON public.domain_users USING btree (((json_attributes ->> 'url_name'::text))) WHERE (type = 'Domain::User::SofurryUser'::public.domain_user_type);
|
||||
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
--
|
||||
@@ -9016,6 +9037,7 @@ ALTER TABLE ONLY public.domain_twitter_tweets
|
||||
SET search_path TO "$user", public;
|
||||
|
||||
INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20250628000003'),
|
||||
('20250626191434'),
|
||||
('20250619233027'),
|
||||
('20250321050628'),
|
||||
|
||||
Reference in New Issue
Block a user