blob: 0ac9ca1200c4afd0272964a2264d16b54abed6f1 (
plain) (
blame)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 | # frozen_string_literal: true
require "cases/helper"
class PostgreSQLPartitionsTest < ActiveRecord::PostgreSQLTestCase
  def setup
    @connection = ActiveRecord::Base.connection
  end
  def teardown
    @connection.drop_table "partitioned_events", if_exists: true
  end
  def test_partitions_table_exists
    skip unless ActiveRecord::Base.connection.postgresql_version >= 100000
    @connection.create_table :partitioned_events, force: true, id: false,
      options: "partition by range (issued_at)" do |t|
      t.timestamp :issued_at
    end
    assert @connection.table_exists?("partitioned_events")
  end
end
 |