Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove keep_private option #141

Merged
merged 6 commits into from
Oct 21, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/components/file-upload-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function FileUploadDialog({
{state.showAdvancedOptions && (
<div className="mt-4 space-y-4 border-t pt-4">
{/* Upload Options */}
<TooltipProvider>
{/* <TooltipProvider>
<div className="flex items-center justify-between">
<Label
htmlFor="keep-private"
Expand Down Expand Up @@ -240,7 +240,7 @@ export function FileUploadDialog({
}
/>
</div>
</TooltipProvider>
</TooltipProvider> */}
<TooltipProvider>
<div className="flex items-center justify-between">
<Label
Expand Down
2 changes: 1 addition & 1 deletion src/lib-server/db_insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const processTwitterArchive = async (
console.log('Inserting archive upload data...')
const { data: archiveUploadId } = await retryOperation(async () => {
const uploadOptions = archiveData['upload-options'] || {
keepPrivate: true,
keepPrivate: false,
uploadLikes: true,
startDate: null,
endDate: null,
Expand Down
74 changes: 1 addition & 73 deletions supabase/migrations/20240925232349_remote_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1542,70 +1542,6 @@ CREATE OR REPLACE FUNCTION "public"."insert_temp_tweets"("p_tweets" "jsonb", "p_

ALTER FUNCTION "public"."insert_temp_tweets"("p_tweets" "jsonb", "p_suffix" "text") OWNER TO "postgres";

CREATE OR REPLACE FUNCTION "public"."pg_search_tweets"("search_query" "text", "p_account_id" "text" DEFAULT NULL::"text") RETURNS TABLE("tweet_id" "text", "account_id" "text", "created_at" timestamp with time zone, "full_text" "text", "retweet_count" integer, "favorite_count" integer, "username" "text", "account_display_name" "text", "avatar_media_url" "text")
LANGUAGE "plpgsql"
AS $$
BEGIN
RETURN QUERY
SELECT
t.tweet_id,
t.account_id,
t.created_at,
t.full_text,
t.retweet_count,
t.favorite_count,
a.username,
a.account_display_name,
p.avatar_media_url
FROM
public.tweets t
INNER JOIN
public.account a ON t.account_id = a.account_id
LEFT JOIN
public.profile p ON a.account_id = p.account_id
WHERE
to_tsvector('english', t.full_text) @@ to_tsquery('english', '''' || replace(search_query, '''', '''''') || '''')
OR t.full_text ILIKE '%' || search_query || '%'
ORDER BY
t.created_at DESC
LIMIT 100;
END;
$$;

ALTER FUNCTION "public"."pg_search_tweets"("search_query" "text", "p_account_id" "text") OWNER TO "postgres";

CREATE OR REPLACE FUNCTION "public"."pg_search_tweets_with_trigram"("search_query" "text", "p_account_id" "text" DEFAULT NULL::"text") RETURNS TABLE("tweet_id" "text", "account_id" "text", "created_at" timestamp with time zone, "full_text" "text", "retweet_count" integer, "favorite_count" integer, "username" "text", "account_display_name" "text", "avatar_media_url" "text")
LANGUAGE "plpgsql"
AS $$
BEGIN
RETURN QUERY
SELECT
t.tweet_id,
t.account_id,
t.created_at,
t.full_text,
t.retweet_count,
t.favorite_count,
a.username,
a.account_display_name,
p.avatar_media_url
FROM
public.tweets t
INNER JOIN
public.account a ON t.account_id = a.account_id
LEFT JOIN
public.profile p ON a.account_id = p.account_id
WHERE
t.full_text % search_query
ORDER BY
similarity(t.full_text, search_query) DESC,
t.created_at DESC
LIMIT 100;
END;
$$;

ALTER FUNCTION "public"."pg_search_tweets_with_trigram"("search_query" "text", "p_account_id" "text") OWNER TO "postgres";

CREATE OR REPLACE FUNCTION "public"."process_and_insert_tweet_entities"("p_tweets" "jsonb", "p_suffix" "text") RETURNS "void"
LANGUAGE "plpgsql" SECURITY DEFINER
AS $_$
Expand Down Expand Up @@ -1664,7 +1600,7 @@ CREATE OR REPLACE FUNCTION "public"."process_and_insert_tweet_entities"("p_tweet
', p_suffix) USING p_tweets;
END;
$_$;

ALTER FUNCTION "public"."process_and_insert_tweet_entities"("p_tweets" "jsonb", "p_suffix" "text") OWNER TO "postgres";

CREATE OR REPLACE FUNCTION "public"."process_archive"("archive_data" "jsonb") RETURNS "void"
Expand Down Expand Up @@ -2850,14 +2786,6 @@ GRANT ALL ON FUNCTION "public"."insert_temp_tweets"("p_tweets" "jsonb", "p_suffi
GRANT ALL ON FUNCTION "public"."insert_temp_tweets"("p_tweets" "jsonb", "p_suffix" "text") TO "authenticated";
GRANT ALL ON FUNCTION "public"."insert_temp_tweets"("p_tweets" "jsonb", "p_suffix" "text") TO "service_role";

GRANT ALL ON FUNCTION "public"."pg_search_tweets"("search_query" "text", "p_account_id" "text") TO "anon";
GRANT ALL ON FUNCTION "public"."pg_search_tweets"("search_query" "text", "p_account_id" "text") TO "authenticated";
GRANT ALL ON FUNCTION "public"."pg_search_tweets"("search_query" "text", "p_account_id" "text") TO "service_role";

GRANT ALL ON FUNCTION "public"."pg_search_tweets_with_trigram"("search_query" "text", "p_account_id" "text") TO "anon";
GRANT ALL ON FUNCTION "public"."pg_search_tweets_with_trigram"("search_query" "text", "p_account_id" "text") TO "authenticated";
GRANT ALL ON FUNCTION "public"."pg_search_tweets_with_trigram"("search_query" "text", "p_account_id" "text") TO "service_role";

GRANT ALL ON FUNCTION "public"."process_and_insert_tweet_entities"("p_tweets" "jsonb", "p_suffix" "text") TO "anon";
GRANT ALL ON FUNCTION "public"."process_and_insert_tweet_entities"("p_tweets" "jsonb", "p_suffix" "text") TO "authenticated";
GRANT ALL ON FUNCTION "public"."process_and_insert_tweet_entities"("p_tweets" "jsonb", "p_suffix" "text") TO "service_role";
Expand Down