Skip to content

Commit

Permalink
feat: Add replication and publication (#419)
Browse files Browse the repository at this point in the history
* feat: Add replication and publication

* fix lint
  • Loading branch information
ashwin1111 authored Dec 24, 2024
1 parent e9e5117 commit cdabe3d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ cache.db-journal
# Dev files
fyle_integrations_platform_connector/
fylesdk/
fyle_accounting_mappings/
fyle_accounting_mappings/
commits.csv
30 changes: 30 additions & 0 deletions apps/fyle/migrations/0023_auto_20241224_0846.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 3.2.14 on 2024-12-24 08:46

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('fyle', '0022_support_split_expense_grouping'),
]

operations = [
migrations.RunSQL(
sql="""
create publication events for all tables;
DO $$
DECLARE
tbl RECORD;
BEGIN
FOR tbl IN
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE' AND table_schema = 'public'
LOOP
EXECUTE format('ALTER TABLE %I.%I REPLICA IDENTITY FULL', tbl.table_schema, tbl.table_name);
END LOOP;
END $$;
""",
),
]
11 changes: 11 additions & 0 deletions deploy_dump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if [ -z "$1" ]; then
echo "Usage: sh $0 '2024-12-09'"
exit 1
fi

base_url="https://github.com/fylein/fyle-xero-api/commit"
branch_name=$(git rev-parse --abbrev-ref HEAD)

git log --since="$1" --pretty=format:"$base_url/%H,%an,%ad,%s,$branch_name,xero-api" > commits.csv

open commits.csv

0 comments on commit cdabe3d

Please sign in to comment.