How to do in Ruby on Jets if adding a new column in database Table


#1

We need to add a new column in database Table. from database side, we can add manually, but how to do for Ruby on Jets files? run some commands or modify files manually? which files need to be modified?

Thanks
George


#2

Jets leverages ActiveRecord migrations. So you use the jets generate migration and jets db:migrate command. More info on the ActiveRecord docs: https://edgeguides.rubyonrails.org/active_record_migrations.html


#3

Thanks, Tung
Let me try it

George


#4

Hi Tung,

db migration works, thank you very much!
I have another problem: when I deploy with “jets deploy”, it works. However when I deploy my own dev environment with “JETS_ENV_EXTRA=2 jets deploy”, I created my environment file .env.development.2, which is pointing S3 buckets, I get error:

08:06:11PM CREATE_FAILED AWS::CloudFormation::Stack S3NewFileJob Embedded stack arn:aws:cloudformation:us-east-2:808836273491:stack/MyRestApi-dev-2-S3NewFileJob- 10F9RLP0PTU3B/fa059800-229a-11ea-b539-0a9fef599330 was not successfully created: The following resource(s) failed to create: [DestinationBucket, S3NewFileJobProcessIamRole].
08:06:11PM CREATE_FAILED AWS::CloudFormation::Stack JetsPreheatJob Resource creation cancelled.
Please advise how to trouble shoot it and fix it.

Thanks
George


#5

You may want to look at the error in the child stack, it’ll have more useful info. Here’s some instructions on how to do that.

http://rubyonjets.com/docs/debugging/cloudformation/


#6

Hi Tung,

Thank you very much! it works now. I can deploy my own dev environment. Inspired by child CloudFormation stack event message, I don’t create S3 buckets manually first, Instead, I let deployment create them, it works.

Regards
George


#7

Hi Tung,

I have another issue in Lambda. before Christmas, our UAT worked fine. After Christmas, it gets timeout error 504. I test from API gateway or test to call lambda directly from aws cli, it is Lambda timeout. I get the following error message from lambda log, could you please advise what is the root cause of the problem? any file is missed?

Thanks
George

“errorMessage”: “Missing template var/task/public/404 with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip, :gzip], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}. Searched in:\n * “/var/task/app/views”\n * “/var/task”\n * “/”\n”,
“errorType”: “Function<ActionView::MissingTemplate>”,


#8

Issue is resolved, thanks