Skip to content

Commit

Permalink
Merge pull request #47 from azuki774/change-flequency-push-history
Browse files Browse the repository at this point in the history
Reduce inserting to import_history
  • Loading branch information
azuki774 authored Aug 28, 2024
2 parents 1cec730 + 96bb316 commit 90e3d85
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 55 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
- name: Migration
run: make migration

- name: Migration Down
run: |
cd migration; \
${SQL_MIGRATE_BIN} down -limit=0 -env=local;
env:
SQL_MIGRATE_BIN: "../vendor_ci/sql-migrate"

services:
mariadb:
image: mariadb:11
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ test:
go test -v ./...

migration:
cd migration; \
${SQL_MIGRATE_BIN} up -env=local; \
cd migration && \
${SQL_MIGRATE_BIN} up -env=local && \
cd ../

generate:
Expand Down
2 changes: 1 addition & 1 deletion docs/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| [detail](detail.md) | 15 | | BASE TABLE |
| [extract_rule](extract_rule.md) | 7 | | BASE TABLE |
| [gorp_migrations](gorp_migrations.md) | 2 | | BASE TABLE |
| [import_history](import_history.md) | 6 | | BASE TABLE |
| [import_history](import_history.md) | 7 | | BASE TABLE |

## Relations

Expand Down
2 changes: 2 additions & 0 deletions docs/schema/import_history.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CREATE TABLE `import_history` (
`new_entry_num` int(11) NOT NULL,
`created_at` datetime DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`src_file` text DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx1` (`job_label`(768))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
Expand All @@ -30,6 +31,7 @@ CREATE TABLE `import_history` (
| new_entry_num | int(11) | | false | | | | |
| created_at | datetime | current_timestamp() | true | | | | |
| updated_at | timestamp | current_timestamp() | true | on update current_timestamp() | | | |
| src_file | text | NULL | true | | | | |

## Constraints

Expand Down
47 changes: 25 additions & 22 deletions docs/schema/import_history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 90e3d85

Please sign in to comment.