-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated project to use sqlite * Edited migrations directly because I fear no man * Updated search functions and tests to work with sqlite * Updated build tools to remove postgres
- Loading branch information
1 parent
53bd868
commit b81c8d6
Showing
29 changed files
with
121 additions
and
186 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -41,3 +41,7 @@ npm-debug.log | |
.DS_Store | ||
scratchpad.md | ||
/scratchpad/ | ||
|
||
# Database files | ||
*.db | ||
*.db-* |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
version: '3' | ||
services: | ||
postgres: | ||
image: 'postgres:16-alpine' | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
|
||
phx: | ||
build: . | ||
volumes: | ||
- '.:/app' | ||
ports: | ||
- '4008:4008' | ||
command: tail -F /dev/null | ||
env_file: .env |
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,12 @@ | ||
version: '3' | ||
services: | ||
postgres: | ||
image: 'postgres:16-alpine' | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
|
||
phx: | ||
build: . | ||
volumes: | ||
- '.:/app' | ||
ports: | ||
- '4008:4008' | ||
depends_on: | ||
- postgres | ||
command: | ||
- ./docker-run.sh | ||
stdin_open: true | ||
tty: true | ||
env_file: | ||
- .env |
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
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,16 @@ | ||
defmodule Pinchflat.Media.MediaItemSearchIndex do | ||
@moduledoc """ | ||
The MediaItem fts5 search index. Not made to be directly interacted with, | ||
but I figured it'd be better to have it in-app so it's not a mystery. | ||
""" | ||
|
||
use Ecto.Schema | ||
|
||
@primary_key {:id, :id, autogenerate: true, source: :rowid} | ||
schema "media_items_search_index" do | ||
field :title, :string | ||
field :description, :string | ||
|
||
field :rank, :float, virtual: true | ||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
defmodule Pinchflat.Repo.Migrations.CreateChannels do | ||
defmodule Pinchflat.Repo.Migrations.CreateSources do | ||
use Ecto.Migration | ||
|
||
def change do | ||
create table(:channels) do | ||
create table(:sources) do | ||
add :name, :string, null: false | ||
add :channel_id, :string, null: false | ||
add :collection_id, :string, null: false | ||
add :collection_type, :string, null: false | ||
add :original_url, :string, null: false | ||
add :media_profile_id, references(:media_profiles, on_delete: :restrict), null: false | ||
|
||
timestamps(type: :utc_datetime) | ||
end | ||
|
||
create index(:channels, [:media_profile_id]) | ||
create unique_index(:channels, [:channel_id, :media_profile_id]) | ||
create index(:sources, [:media_profile_id]) | ||
create unique_index(:sources, [:collection_id, :media_profile_id]) | ||
end | ||
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
4 changes: 2 additions & 2 deletions
4
priv/repo/migrations/20240125165519_add_index_frequency_to_channels.exs
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
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
Oops, something went wrong.