'This code is handled only when in the following conditions:
1. The file path matches .../db/migrate/*.rb
2. It\'s in a class that inherits from ActiveRecord::Migration
3. It\'s in a function called "self.up"
Database fields are found through two functions:
create_table TABLE-NAME do |handle|
handle.column COLUMN-NAME TYPE
end
To add:
add_column TABLE-NAME COLUMN-NAME TYPE'

def _parse_migration_create_table_block(self):

    tok = self.tokenizer.get_next_token()
    if (not (self.classifier.is_symbol(tok) or self.classifier.is_string(tok))):
        return
    rails_migration_info = RailsMigrationData()
    rails_migration_info.tableHookName = self._actual_string_from_string_or_symbol(tok)
    rails_migration_info.startLine = tok['start_line']
    rails_migration_info.endLine = (tok['start_line'] + 1)
    tok = self.tokenizer.get_next_token()
    if (self.classifier.is_operator(tok, '{') or self.classifier.is_keyword(tok, 'do')):
        control_tok = (tok['style'], (((tok['text'] == '{') and '}') or 'end'))
    else:
        return
    tok = self.tokenizer.get_next_token()
    if (not self.classifier.is_operator(tok, '|')):
        return
    tok = self.tokenizer.get_next_token()
    if (not self.classifier.is_identifier(tok)):
        return
    table_handle = tok['text']
    tok = self.tokenizer.get_next_token()
    if (not self.classifier.is_operator(tok, '|')):
        return
    add_entry = False
    while True:
        tok = self.tokenizer.get_next_token()
        if (tok['style'] == shared_lexer.EOF_STYLE):
            break
        elif ((tok['style'] == control_tok[0]) and (tok['text'] == control_tok[1])):
            rails_migration_info.endLine = tok['end_line']
            break
        elif (self.classifier.is_identifier(tok) and (tok['text'] == table_handle)):
            tok = self.tokenizer.get_next_token()
            if self.classifier.is_operator(tok, '.'):
                tok = self.tokenizer.get_next_token()
                if self.classifier.is_identifier(tok):
                    line_num = tok['start_line']
                    if (tok['text'] == 'column'):
                        tok = self.tokenizer.get_next_token()
                        if (self.classifier.is_symbol(tok) or self.classifier.is_string(tok)):
                            column_name = self._actual_string_from_string_or_symbol(tok)
                            tok = self.tokenizer.get_next_token()
                            if self.classifier.is_operator(tok, ','):
                                tok = self.tokenizer.get_next_token()
                                if (self.classifier.is_symbol(tok) or self.classifier.is_string(tok)):
                                    column_type = self._actual_string_from_string_or_symbol(tok)
                                else:
                                    column_type = ''
                                add_entry = True
                    elif (tok['text'] in self._rails_migration_types):
                        column_type = tok['text']
                        tok = self.tokenizer.get_next_token()
                        log.debug('Migration:    add    %s:%s', tok['text'], column_type)
                        if (self.classifier.is_symbol(tok) or self.classifier.is_string(tok)):
                            column_name = self._actual_string_from_string_or_symbol(tok)
                            add_entry = True
                    elif (tok['text'] == 'timestamps'):
                        column_type = 'datetime'
                        rails_migration_info.columns.append(('created_at', column_type, line_num))
                        rails_migration_info.endLine = (line_num + 1)
                        column_name = 'updated_at'
                        add_entry = True
                    if add_entry:
                        rails_migration_info.columns.append((column_name, column_type, line_num))
                        rails_migration_info.endLine = (line_num + 1)
                        add_entry = False
                        continue
        if ((tok['style'] == ScintillaConstants.SCE_RB_WORD) and (tok['text'] in ('class', 'def'))):
            self.tokenizer.put_back(tok)
            return
    self.rails_migration_block.data.append(rails_migration_info)
