Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
df8e46f6
Commit
df8e46f6
authored
Sep 09, 2021
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise helpful error instead of undef method
parent
3eb7f79f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
lib/gitlab/database/migration_helpers/v2.rb
lib/gitlab/database/migration_helpers/v2.rb
+15
-1
No files found.
lib/gitlab/database/migration_helpers/v2.rb
View file @
df8e46f6
...
@@ -7,7 +7,21 @@ module Gitlab
...
@@ -7,7 +7,21 @@ module Gitlab
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
# Superseded by `create_table` override below
# Superseded by `create_table` override below
undef_method
:create_table_with_constraints
def
create_table_with_constraints
(
*
_
)
raise
<<~
EOM
#create_table_with_constraints is not supported anymore - use #create_table instead, for example:
create_table :db_guides do |t|
t.bigint :stars, default: 0, null: false
t.text :title, limit: 128
t.text :notes, limit: 1024
t.check_constraint 'stars > 1000', name: 'so_many_stars'
end
See https://docs.gitlab.com/ee/development/database/strings_and_the_text_data_type.html
EOM
end
# Creates a new table, optionally allowing the caller to add text limit constraints to the table.
# Creates a new table, optionally allowing the caller to add text limit constraints to the table.
# This method only extends Rails' `create_table` method
# This method only extends Rails' `create_table` method
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment