Skip to content

Commit

Permalink
Add test for postgres to check datetime without timezone
Browse files Browse the repository at this point in the history
Fixed: Postgres timezone issues

Co-authored-by: ta264 <ta264@users.noreply.github.com>
(cherry picked from commit d55864f86914199aa0c4ee37df1e42e6ad71ef4f)
(cherry picked from commit c006b66aa470616ec30994d0b95e3bd307aa82bd)
  • Loading branch information
RobinDadswell authored and mynameisbogdan committed May 25, 2023
1 parent 149c18d commit 79d4e1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/NzbDrone.Core.Test/Datastore/DatabaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ public void vacuum()
Mocker.Resolve<IDatabase>().Vacuum();
}

[Test]
public void postgres_should_not_contain_timestamp_without_timezone_columns()
{
if (Db.DatabaseType != DatabaseType.PostgreSQL)
{
return;
}

Mocker.Resolve<IDatabase>()
.OpenConnection().Query("SELECT table_name, column_name, data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'public' AND data_type = 'timestamp without time zone'")
.Should()
.BeNullOrEmpty();
}

[Test]
public void get_version()
{
Expand Down

0 comments on commit 79d4e1a

Please sign in to comment.