-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A better approach - have a log per day
- Loading branch information
Showing
9 changed files
with
148 additions
and
80 deletions.
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
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
29 changes: 29 additions & 0 deletions
29
src/core/migrations/versions/2024_01_07_16_39_better_indices_on_journal.py
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,29 @@ | ||
"""Better indices on journal | ||
Revision ID: 700375030fae | ||
Revises: 008a3a72fb29 | ||
Create Date: 2024-01-07 16:39:03.373383 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "700375030fae" | ||
down_revision = "008a3a72fb29" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
""" | ||
CREATE UNIQUE INDEX ix_journal_journal_collection_ref_id_right_now ON journal (journal_collection_ref_id, right_now) | ||
WHERE archived=0; | ||
""" | ||
) | ||
op.execute("""DROP INDEX ix_journal_journal_collection_ref_id_period_timeline;""") | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { JournalSource } from "jupiter-gen/dist/models/JournalSource"; | ||
import { SlimChip } from "./infra/chips"; | ||
import { journalSourceName } from "~/logic/domain/journal"; | ||
import { SlimChip } from "./infra/chips"; | ||
|
||
interface Props { | ||
source: JournalSource; | ||
source: JournalSource; | ||
} | ||
|
||
export function JournalSourceTag({ source }: Props) { | ||
const tagName = journalSourceName(source); | ||
const tagClass = sourceToClass(source); | ||
return <SlimChip label={tagName} color={tagClass}/>; | ||
const tagName = journalSourceName(source); | ||
const tagClass = sourceToClass(source); | ||
return <SlimChip label={tagName} color={tagClass} />; | ||
} | ||
|
||
function sourceToClass(source: JournalSource): "info" | "warning" { | ||
switch (source) { | ||
case JournalSource.USER: | ||
return "info"; | ||
case JournalSource.RECURRING: | ||
return "warning"; | ||
} | ||
} | ||
switch (source) { | ||
case JournalSource.USER: | ||
return "info"; | ||
case JournalSource.RECURRING: | ||
return "warning"; | ||
} | ||
} |
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
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