Switch to sqlite (#22)

* 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
This commit is contained in:
Kieran
2024-02-16 10:11:41 -08:00
committed by GitHub
parent 44bd105e80
commit 8fcd41f45d
29 changed files with 121 additions and 186 deletions
+8
View File
@@ -212,6 +212,14 @@ defmodule Pinchflat.MediaTest do
assert [_] = Media.search("dog", limit: 1)
end
test "returns an empty list when the search term is blank" do
assert [] = Media.search("")
end
test "returns an empty list when the search term is nil" do
assert [] = Media.search(nil)
end
end
describe "get_media_item!/1" do
-1
View File
@@ -34,7 +34,6 @@ defmodule PinchflatWeb.ConnCase do
setup tags do
Pinchflat.DataCase.setup_sandbox(tags)
Pinchflat.DataCase.setup_temp_filepaths()
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
end
-14
View File
@@ -32,20 +32,6 @@ defmodule Pinchflat.DataCase do
setup tags do
Pinchflat.DataCase.setup_sandbox(tags)
Pinchflat.DataCase.setup_temp_filepaths()
:ok
end
@doc """
Sets up the temp filepaths for the media and metadata directories.
"""
def setup_temp_filepaths do
File.rm_rf!(Application.get_env(:pinchflat, :media_directory))
File.rm_rf!(Application.get_env(:pinchflat, :metadata_directory))
File.mkdir_p!(Application.get_env(:pinchflat, :media_directory))
File.mkdir_p!(Application.get_env(:pinchflat, :metadata_directory))
:ok
end