Skip to content

Commit

Permalink
Fix translation of date type in schemaTranslator
Browse files Browse the repository at this point in the history
  • Loading branch information
MXPOL committed Dec 5, 2023
1 parent 9d769bc commit 642a273
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('Sql Schema Column Translator', () => {

describe('date time fields', () => {

test.each(['DATETIME', 'TIMESTAMP'])('%t', (t) => {
test.each(['DATETIME', 'TIMESTAMP'])('%s', (t) => {
expect( env.schemaTranslator.translateType(t) ).toEqual('datetime')
})

Expand Down
15 changes: 11 additions & 4 deletions libs/external-db-mysql/src/sql_schema_translator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ describe('Sql Schema Column Translator', () => {
})

describe('date time fields', () => {
test('date', () => {
['DATE', 'DATETIME', 'TIMESTAMP', 'TIME', 'YEAR'].forEach(t => {
expect( env.schemaTranslator.translateType(t) ).toEqual('datetime')
})
test.each([ 'DATETIME', 'TIMESTAMP' ])('%s', (t) => {
expect( env.schemaTranslator.translateType(t) ).toEqual('datetime')
})


test('time', () => {
expect( env.schemaTranslator.translateType('TIME') ).toEqual('time')
})

test('date', () => {
expect( env.schemaTranslator.translateType('DATE') ).toEqual('date3')
})
})

describe('json fields', () => {
Expand Down

0 comments on commit 642a273

Please sign in to comment.