ToolJet/db/migrate/20210619124759_add_slug_to_apps.rb
Akshay b30b0b0b10
Feature: Friendly URLs for applications (#285)
* add migration to create slug for apps

* update migration file to include default slug population

* update schemafile

* add capability to get app by slug

* add capability to frontend to set and fetch app by slug

* remove unrelated changes from lint

* respond default 204 itself when success else render error

* make input field to show error when slug taken

* wip: show error message

* Cleanup

* add new route to fetch app by slug

* add slug to show json jbuilder

* update react components to fetch app by both id and slug

* fix launch link not being set

Co-authored-by: navaneeth <navaneethpk@outlook.com>
2021-06-22 20:03:13 +05:30

10 lines
225 B
Ruby
Executable file

class AddSlugToApps < ActiveRecord::Migration[6.1]
def change
add_column :apps, :slug, :string
add_index :apps, [:organization_id, :slug]
App.find_each do |app|
app.update(slug: app.id)
end
end
end