Open AaronMcCloskey opened 2 years ago
You should put a name
into @PrimaryGeneratedColumn()
and remove the @Column()
decorator. Here how it should look:
@Field(() => String)
@PrimaryGeneratedColumn({ name: 'account_number' })
accountNumber!: string;
This is affected by how you create createQueryBuilder
With createQueryBuilder('t')
, and you can use .where('t.accountNumber ...')
for column account_number
, but if you use createQueryBuilder()
, then you have to use .where('account_number...')
Issue Description
I have a pre-existing database table that has a column with a name of
account_number
, however, I wanted to reference this column in my code asaccountNumber
instead.I have the following entity where I set the column name for the property type of
accountNumber
to beaccount_number
...This is the query builder that I am having an issue with
Expected Behavior
Query to resolve using the
account_number
column as is stated in theColumn
decorator.Actual Behavior
However, it seems to want to use
accountNumber
instead ofaccount_number
even though I have set it as so in the EntityMy Environment
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?