Skip to content

Commit cdabe3d

Browse files
authored
feat: Add replication and publication (#419)
* feat: Add replication and publication * fix lint
1 parent e9e5117 commit cdabe3d

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,5 @@ cache.db-journal
159159
# Dev files
160160
fyle_integrations_platform_connector/
161161
fylesdk/
162-
fyle_accounting_mappings/
162+
fyle_accounting_mappings/
163+
commits.csv
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 3.2.14 on 2024-12-24 08:46
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('fyle', '0022_support_split_expense_grouping'),
10+
]
11+
12+
operations = [
13+
migrations.RunSQL(
14+
sql="""
15+
create publication events for all tables;
16+
DO $$
17+
DECLARE
18+
tbl RECORD;
19+
BEGIN
20+
FOR tbl IN
21+
SELECT table_schema, table_name
22+
FROM information_schema.tables
23+
WHERE table_type = 'BASE TABLE' AND table_schema = 'public'
24+
LOOP
25+
EXECUTE format('ALTER TABLE %I.%I REPLICA IDENTITY FULL', tbl.table_schema, tbl.table_name);
26+
END LOOP;
27+
END $$;
28+
""",
29+
),
30+
]

deploy_dump.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
if [ -z "$1" ]; then
2+
echo "Usage: sh $0 '2024-12-09'"
3+
exit 1
4+
fi
5+
6+
base_url="https://github.com/fylein/fyle-xero-api/commit"
7+
branch_name=$(git rev-parse --abbrev-ref HEAD)
8+
9+
git log --since="$1" --pretty=format:"$base_url/%H,%an,%ad,%s,$branch_name,xero-api" > commits.csv
10+
11+
open commits.csv

0 commit comments

Comments
 (0)