Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

adding a value for each row, but not in the schema #343

Closed
reharik opened this Issue · 2 comments

3 participants

@reharik

Hi, is there a way to add a column to a table, then set the value of said column to a specific value. For instance new column named "Status" you want everyone to be "Active" until you set it otherwise. Default Value of course works but it set's the Column Schema Default Value. I just want to do a one time insert.
If there is not such a feature then I will dig in and build it out and offer it back. But if it's already there, then I'd rather not do the digging just yet.
Thanks,
Raif

@tommarien
Collaborator

@reharik Hey Raif, well you have to do something, either you add the column nullable and then do an update and alter column again to be non nullable, or you use a default which you can remove after again

@daniellee
Collaborator

Not much more to say here. Tom's solution looks perfectly reasonable to me.

@daniellee daniellee closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.