pg_spec_helper 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49e5716d13c3a2fb075f01e431d9a0eff5993fbb1b1063ea8079a8c98e6bfbfe
4
- data.tar.gz: 02bc59e4925df21164c3d4bfeced975a44c5a651c65f3a51c2eb48985909e8c6
3
+ metadata.gz: c1285cbc5b11e282ca1e564530c3b031bf0d8455a48d7f7e2b6af112216e0287
4
+ data.tar.gz: 9c63189e6193d584bae3e84081c50a3dc151e4b717044eee56da6b18e78da48c
5
5
  SHA512:
6
- metadata.gz: 192264003c26963902a5aab06a29d3e420d9b4b28d59985a7a469ea7c3dd6e45ba01a9d9faa93d060475178e7efaf2afedba2a24eadbd64e0b89627b97dbd0a2
7
- data.tar.gz: 7bd2b7754f23ede028474b19d0d3ab2854c5f7a8a7f18426dc606fceb70ab1a42c969c8657aa23ce40d08c3a75fa66879d6fd5d1efdca462909e9383f4da4c7b
6
+ metadata.gz: f150ef8957731ef55129548b3f8ccc3ff95bf211d57b2b01850df80cba4d080d72323095ee0f1648f8189fcf9487a6d9c418e53565047f8509942a05c71f4039
7
+ data.tar.gz: 77ad4f5fde90f10bf13eae8390a157adb281ee1e910992b4531604dd8cdef71e72286c38caf887814b051aab74e5d6cd81d4dc0b5e96070bc0c5a245cb3fba2f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/craigulliott/pg_spec_helper/compare/v1.2.0...v1.3.0) (2023-07-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * Dont delete the public schema, just remove all the tables instead. This is useful if you have materialized views in the public schema ([9f69160](https://github.com/craigulliott/pg_spec_helper/commit/9f691602bc851fbeea0d01a0f8e9a7555f154e35))
9
+
3
10
  ## [1.2.0](https://github.com/craigulliott/pg_spec_helper/compare/v1.1.0...v1.2.0) (2023-07-10)
4
11
 
5
12
 
data/README.md CHANGED
@@ -28,7 +28,7 @@ This gem is concerned with the **structure** of your database, not the data/reco
28
28
  * Resets your database after each spec, but only if the spec made changes
29
29
  * Ignores `information_schema` and any schemas or tables with names beginning with `pg_`
30
30
  * Configurable to ignore other schemas (such as `postgis`)
31
- * Automatically resets and recreates the `public` schema
31
+ * Deletes tables from within the `public` schema, but does not delete the actual schema during cleanup.
32
32
  * Can track and refresh materialized views
33
33
  * Easily access the `PG::Connection` object via `pg_spec_helper.connection` to execute your own SQL
34
34
 
@@ -52,11 +52,9 @@ And run bundle install
52
52
 
53
53
  Note, this gem depends on the postgres gem `pg`, which depends on the `libpq` package. On Apple Silicon you can run the following commands before installation to prepare your system.
54
54
 
55
- ```
56
55
  # required for pg gem on apple silicon
57
56
  $ brew install libpq
58
57
  $ export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
59
- ```
60
58
 
61
59
  ## Getting Started
62
60
 
@@ -26,8 +26,8 @@ class PGSpecHelper
26
26
 
27
27
  # delete all schemas in the database
28
28
  def delete_all_schemas
29
- # delete all schemas
30
- get_schema_names.each do |schema_name|
29
+ # delete all schemas except public
30
+ get_schema_names.reject { |schema_name| schema_name == :public }.each do |schema_name|
31
31
  connection.exec(<<-SQL)
32
32
  -- temporarily set the client_min_messages to WARNING to
33
33
  -- suppress the NOTICE messages about cascading deletes
@@ -36,8 +36,8 @@ class PGSpecHelper
36
36
  SET client_min_messages TO NOTICE;
37
37
  SQL
38
38
  end
39
- # recreate the default `public` schema
40
- create_schema :public
39
+ # delete all the tables from within the public schema
40
+ delete_tables :public
41
41
  end
42
42
 
43
43
  def schema_exists? schema_name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.2.0"
4
+ VERSION = "1.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_spec_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott