Insert null foreign key fields in postgres #2130
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2130
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
I am new to XORM, and for the moment it looks great. I am having some problems (maybe because of my inexperience in go and xorm) with relationships between tables.
This is my model definition:
Initially
DeviceID
was defined asstring
, but then it was impossible to insert anAsset
withdevice_id=NULL
, it was trying to insert all the time an empty string.This is the database definition:
This solution works for now, but I am not very confortable with it.
Is there any alternative?
Also, is there any way to define a
Device
in Asset so I can access Device with an statement like:asset.device.ID
?I have another project where I was using XORM, and I was able to do it, but I was using autoincremented ints. Is maybe the usage of int for primary id recommended?
Thank you very much!
Xavi