New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Mark as Deleted for Backend Api #1144
Conversation
ed36f41
to
9a59922
Compare
So I am thinking of not really use any other column but only do it when the service is not a product |
I do not think this column is needed at all, |
9a59922
to
b3cb4cf
Compare
So decision is to use the mark as deleted because of the points that @Martouta issued. |
b3cb4cf
to
2173fdc
Compare
Codecov Report
@@ Coverage Diff @@
## master #1144 +/- ##
=========================================
Coverage ? 67.65%
=========================================
Files ? 1590
Lines ? 43312
Branches ? 0
=========================================
Hits ? 29301
Misses ? 14011
Partials ? 0
Continue to review full report at Codecov.
|
2173fdc
to
ec5d8f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🥇 🚀
ec5d8f1
to
7c0f080
Compare
test/integration/provider/admin/backend_apis_controller_test.rb
Outdated
Show resolved
Hide resolved
7c0f080
to
0b0eb50
Compare
0b0eb50
to
9fd4e84
Compare
315ca82
to
87b4dec
Compare
disable_ddl_transaction! if System::Database.postgres? | ||
|
||
def change | ||
add_column :backend_apis, :state, :string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a default here I think. On SaaS:
irb(main):001:0> BackendApi.count
=> 37183
It will be blocking but reasonably, and in fact it might not block at all, there are very few requests that modifies the private_endpoint
class BackfillStateForBackendApis < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extract it to a rake task so we can do it after migration from 2.6 to 2.7
@@ -16,6 +17,7 @@ class BackendApi < ApplicationRecord | |||
delegate :default_api_backend, to: :class | |||
|
|||
validates :name, length: { maximum: 511 }, presence: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was wondering
Why do we have 511 characters here????
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahahahaha good question 😂 i will check 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 235 in 7131eb1
t.string "name", limit: 511, null: false |
c2204dc#diff-e2de550cd7105b0cc383c49f401ca88dR6
805b0e7
to
35af93a
Compare
THREESCALE-3343 This commit changed the behave of the destroy action from the Backend API controller to make it delete the object in background.
e4f1b30
to
cbe0c84
Compare
cbe0c84
to
c98f764
Compare
disable_ddl_transaction! if System::Database.postgres? | ||
|
||
def change | ||
safety_assured { add_column :backend_apis, :state, :string, default: :published, null: false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fill up the DB 😉
What this PR does / why we need it:
This commit changed the behave of the destroy action from the
Backend API controller to make it delete the object in background.
Which issue(s) this PR fixes
THREESCALE-3343