code0-zero_track 0.0.6 → 0.0.7

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: b8f8699266ab0945d67b73857df2ea63b2fe59a3eb97e29d1fd165d04c8d92b6
4
- data.tar.gz: 222c86520fdf1dd39b994f34863798dc40c9f0cbb77ff81961bb947f482a35c6
3
+ metadata.gz: 6ba30f4224e83da8ce5d9c86233ccd8bec8f480636f50306bb5f786b5875867d
4
+ data.tar.gz: a47c562d06286ebd35c977e4825af11cf4de5d87c5339d15a4047d57ad0b7b4b
5
5
  SHA512:
6
- metadata.gz: 709fd753597fff13820c23ced5efc314edce4a2e3a473b4afb99735429a0497b6242f91ebd66c5c4f1bc7fd07f38d8f3885b5c1a691b123cf01ba0b26d347a51
7
- data.tar.gz: b7389f87b10557fae6a7733c1e87e38c5b59375a7a1cf45f9ed2158fadf65ebdef20882733d7a63307f5527a9e03b293fbb1c2e6c2f7f5f3de7f801b178f2e44
6
+ metadata.gz: 8318133e64d693242f17415dda6aae7d70bcc0e27533a2f6ba67a5ca2547568770038ba2f0638dc7cbec73cf9e1e175948219c1315424921191d41165c98ac63
7
+ data.tar.gz: 90bb401d956616f4c6f5979073dbbdf4b8c97dcbd0b55aa53aebf1ab48ec99d4cba72c9ca4e878efc77391819ff5040767fab34b3513122e764eeec3e39eceba
data/LICENSE CHANGED
@@ -1,20 +1,9 @@
1
- Copyright Niklas van Schrick
1
+ Copyright 2023-2026 Code0 UG (haftungsbeschränkt) i.G.
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
4
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
6
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ AI Usage Restriction: Notwithstanding the permissions granted above, this Software and its source code may not be used, in whole or in part, for the purpose of training, fine-tuning, or developing artificial intelligence (AI) models or machine learning algorithms without prior written consent from the Copyright Holder.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -9,6 +9,7 @@ module Code0
9
9
  include Database::MigrationHelpers::AddColumnEnhancements
10
10
  include Database::MigrationHelpers::ConstraintHelpers
11
11
  include Database::MigrationHelpers::IndexHelpers
12
+ include Database::MigrationHelpers::RemoveColumnEnhancements
12
13
  include Database::MigrationHelpers::TableEnhancements
13
14
  end
14
15
  # rubocop:enable Naming/ClassAndModuleCamelCase
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Code0
4
+ module ZeroTrack
5
+ module Database
6
+ module MigrationHelpers
7
+ module RemoveColumnEnhancements
8
+ def remove_column(table_name, column_name, type = nil, **kwargs)
9
+ if type == :text
10
+ limit = kwargs.delete(:limit)
11
+ unique = kwargs.delete(:unique)
12
+
13
+ if limit
14
+ quoted_column_name = quote_column_name(column_name)
15
+ name = text_limit_name(table_name, column_name)
16
+ definition = "char_length(#{quoted_column_name}) <= #{limit}"
17
+
18
+ remove_check_constraint(table_name, definition, name: name)
19
+ end
20
+
21
+ if unique.is_a?(Hash)
22
+ quoted_column_name ||= quote_column_name(column_name)
23
+ index_column = column_name
24
+ unique[:where] = "#{column_name} IS NOT NULL" if unique.delete(:allow_nil_duplicate)
25
+ index_column = "LOWER(#{quoted_column_name})" if unique.delete(:case_insensitive)
26
+
27
+ remove_index table_name, index_column, unique: true, **unique
28
+ elsif unique
29
+ remove_index table_name, column_name, unique: unique
30
+ end
31
+ end
32
+
33
+ super
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Code0
4
4
  module ZeroTrack
5
- VERSION = '0.0.6'
5
+ VERSION = '0.0.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code0-zero_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niklas van Schrick
@@ -165,6 +165,7 @@ files:
165
165
  - lib/code0/zero_track/database/migration_helpers/add_column_enhancements.rb
166
166
  - lib/code0/zero_track/database/migration_helpers/constraint_helpers.rb
167
167
  - lib/code0/zero_track/database/migration_helpers/index_helpers.rb
168
+ - lib/code0/zero_track/database/migration_helpers/remove_column_enhancements.rb
168
169
  - lib/code0/zero_track/database/migration_helpers/table_enhancements.rb
169
170
  - lib/code0/zero_track/database/postgresql_adapter/dump_schema_versions_mixin.rb
170
171
  - lib/code0/zero_track/database/postgresql_database_tasks/load_schema_versions_mixin.rb