I'm not sure if you mean you want the column name to be external_id
or if you just are wondering how to get an external id (foreign key). I'm going to assume the latter since this is how a relational db is usually set up.
When you make a model, you would do it like this, for example:
rails g model user email:string password:string
rails g model sale user:references amount:decimal
More here
That would create tables that look like this:
Users
email: string
password: string
Sales
user_id: integer
amount: decimal
Where user_id
is the foreign key to the user associated with that sale since a user has many sales and a sale belongs to a user.
Remember: the id of the 1 goes on the many.