-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add replication and publication (#419)
* feat: Add replication and publication * fix lint
- Loading branch information
1 parent
e9e5117
commit cdabe3d
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $$; | ||
""", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |