►
From YouTube: Entity Framework Community Standup - Sept 16th 2020 - What's New with Migrations in EF Core 5.0
Description
The Entity Framework Core team focused on major improvements to migrations for the EF Core 5.0 release. Learn about what's new and explore different migrations scenarios in this demo-heavy session. As always, the team will be standing by live to answer your questions!
Community Links: https://www.theurlist.com/efcore-standup-2020-09-16
Featuring: EFCore Team (@efmagicunicorns)
A
A
A
A
Hello
and
welcome
to
another
episode
of
the
entity
framework
core
community
stand
up
thanks
everyone
for
joining
us
today.
We
have
a
deep
dive
into
migrations
before
we
get
started,
we're
going
to
look
at
a
few
community
links
and
I'm
going
to
go
around
and
introduce
the
team.
My
name
is:
jeremy
likness,
I'm
a
program
manager
for
dotnet
data,
and
today
we
have
with
us
arthur.
A
Let
me
get
the
stream
set
up
here
there
we
go
nice
set
of
links,
so
the
first
thing
is
an
announcement
from
oracle
and
they
have
finally
released
to
production
very
exciting,
milestone
the
oracle
provider
for
entity
framework
core
3.1.
So
if
you're
an
oracle
developer,
you
now
have
a
production
provider
to
connect
the
oracle
from
entity
framework
core
3.1.
B
Sorry
this
is
this
is
great
to
see
I'll
say
that
you
know,
as
I
think
most
people
are
aware.
The
upgrade
from
2x
to
3
3x
was
pretty
difficult
for
providers,
which
may
explain
why
this
is
a
little
bit
later
than
some
of
the
other
providers,
but
it
should
be
easier
going
from
three
one
to
five
so
now
this
is
out
there.
Hopefully
they'll
be
able
to
get
work
working
on
a
on
a
5.0
provider
pretty
soon.
A
Awesome
our
next
link-
this
was
a
fun
link
and
a
fun
read
playing
with
entity
framework
or
five
and
stack
overflow
data.
So
the
the
relevant
things
around
this
post
are
that
they
work
with
a
pretty
large
data
set
that's
available
for
anyone
to
pull
down.
I
think
it
was
like
18
gigabytes
that
they
ended
up
with.
I
think.
A
B
So
what
I
meant
was
the
18
gigabyte,
one
that
they
use
is
actually
one
of
the
smaller
data
sets
that
stack
exchange
has
so
I
wasn't
aware
of
this
before
this
is
this:
is
a
really
cool
stuff
and
really
cool
to
have
this
data
available
from
stack
exchange
for
doing
some
testing
over
bigger
sizes
of
data
than
than
most
of
our
sample
applications
have.
A
Yeah,
I'm
excited
to
see
people
just
working
with
entity
framework
core,
of
course
we'll
talk
about
that
in
a
second,
but
our
release
candidate
is
out
and
we
definitely
want
people
to
jump
on
this
and
start
giving
us
feedback,
but
before
we
get
to
that,
I
want
to
share
this
blog
post
seating
data
with
in
entity
framework
core
using
sql
scripts.
Let
me
add
a
shy
just
join
us.
A
Hello,
shy
welcome
to
the
show,
so
this
is
another
way
of
seeding
data
in
entity
framework
core-
and
I
don't
know
if
bryce
is
going
to
talk
about
seeding
data
as
part
of
the
migrations
or
not,
but
there's
a
few
different
approaches.
If
you're
familiar
with
entity
framework,
you
can
see
through
code,
you
can
see
through
database,
you
can
do
it
completely
out
of
band
and
not
use
any
framework,
and
this
is
focused
specifically
on
the
sql
script
approach.
A
Okay,
well,
there's
a
blog
post
to
do
that,
and
here's
the
the
big
announcement
release
candidate,
one
I
feel
like
we
should
have
like
a
bull
horn
and
and
some
confetti
to
throw.
But
this
is
a
a
massive
release
if
you
take
a
look
at
the
the
post
and
just
scroll
through
the
features
that
are
in
this,
the
the
feature
list
is
is
pretty
impressive
and
it's
cumulative
right
from
all
of
the
the
previous
releases.
A
So
this
is
one
that
has
a
go
live
license:
you're
allowed
to
run
it
in
production,
it
is
considered
stable,
but
it
is
our
our
chance
to
address
any
critical
issues
that
come
up
from
anyone
using
this
between
now
and
when
the
final
release
comes
out.
I
don't
know
if
anyone
has
other
thoughts
or
comments
on
the
rc1
release.
B
So
I
mean
just
to
add
to
what
jeremy
said
this
is
feature
complete,
we're
not
adding
anything
more
by
design.
So
if
you
test
it
on
here
and
it
doesn't
work,
then
it
isn't
going
to
work
when
we
release
it.
B
So
if
you
test
it
on
here
and
let
us
know,
we
may
be
able
to
fix
the
bug
or
something
else
before
we
release
that's
unlikely
to
be
add
new
features,
but
we
put
a
lot
of
stuff
in
ef
core
5
and
there
are
going
to
be
bugs
that
we
just
don't
know
about
that's
the
reality.
Even
though
we
have
you
know
70
000
tests,
that's
the
reality
of
a
fairly
complex
product,
with
lots
of
interactions.
B
So
the
more
we
get
testing
on
rc1
the
more
we
can
fix
those
before
we
even
go
rtm,
which
I
think
will
be
benefit
everyone
so
really
encourage
you
to
to
get
the
rc1.
B
You
know
supported
on,
go,
live,
you
don't
need
a
daily
build
feed
so
so
go
for
it
and
with
regard
to
the
features
we
we
list,
the
rc1
features
in
the
blog
post,
but
there's
a
link
also
in
the
blog
post,
to
our
documentation,
where
we
have
an
overview
of
all
of
the
features
for
all
of
the
different
previews
that
are
going
in.
You
know
that
will
be
in
the
final
release.
So
take
take
a
look
at
that
too.
A
Awesome
news
and
then
my
last
link
I'm
not
going
to
spend
too
much
time
on
because
it
ties
directly
into
what
bryce
is
about
to
cover.
But
I
added
the
link
to
the
migrations
overview
in
our
documentation,
but
without
further
ado,
because
the
focus
of
this
episode
is
migrations.
I'm
going
to
turn
things
over
to
bryce.
C
All
right,
I
guess
we
should
probably
start
by
saying
what
are
migrations.
I
know.
Hopefully,
we
get
a
lot
of
new
viewers.
Our
viewers
new
to
ef
on
this
show,
so
migrations
are
a
way
of
bringing
your
database
schema
to
match
your
domain
model,
and
so
a
migration
is
sort
of
the
steps
that
your
database
needs
to
take
in
order
to
become
in
sync,
with
your
with
your
model
that
you
use
for
your
application,
I'm
going
to
start
sharing
here.
C
And
I
have
here
a
a
pretty
interesting
sorry,
a
pretty
interesting
app.
I
wanted
to
throw
something
together.
That
was
interesting.
It's
not
just
a
console
app,
it's
a
console
app
with
generic
host,
so
we're
really
stepping
up
our
game
here,
and
so,
if
you're
not
familiar
with
generic
host,
it's
basically
like
the
asp.net
application
model
without
an
http
server
running.
D
C
My
worker
right
really
doesn't
do
anything
right
now
it
every
day
it
goes
and
kicks
off
this
execute
task.
This
execute
task
creates
a
service
scope
which
is
similar
to
what
asp.net
does
for
a
request,
and
then
I
go
ahead
and
get
my
db
context
out
of
there,
and
I
do
something
interesting,
or
at
least
it
will
eventually.
You
know
the
focus.
C
The
application,
though,
it's
on
the
migrations.
So
if
I
go
back
to
program
where
I
add
my
db
context,
first.
E
C
There's
also
this
interesting
thing
here,
this
migrations
assembly,
I
have
one
migrations
assembly
for
sql,
lite
and
another
migrations
assembly
for
sql
server.
We
call
these
things.
Migration
sets-
and
here
I
have
two
sets
one
for
sql
server
and
one
for
sql
lite,
but
you
can
imagine
you
have
one
set
for
day-to-day
development
and
maybe
another
set
for
like
release
to
release
in
production
and
so
that
way,
when
you
migrate
production,
you
don't
have
to
go
through
every
little
step.
It
took
you
to
get
there
during
development.
C
You
can.
You
can
have
a
much
more
streamlined
v1
to
v2
to
v3
sort
of
thing.
So,
let's
look
at
how
these
migrations
assemblies
work
over
here.
I
have
two
assemblies
we'll
look
at
the
sql
server
one.
All
it
is
is
a
net
five
class
library
and
it
references
my
main
project.
It
has
to
reference
the
db
context.
C
So
whenever
I
build
this
assembly,
it'll
just
go
next
to
the
main
application
and
my
main
application
doesn't
have
to
reference
it
again.
If
I
had
a
data
layer,
I
could
actually
add
a
reference
to
here
because
there's
a
inversion
of
control
right,
there's
one
more
level
of
that
it
can
go
through
and
I
could
have
a
reference.
So
I've
seen
people
struggling
with
this
in
the
past,
so
I
really
wanted
to
show.
This
is
a
cheap
way
to
get
little
migration
sets.
D
C
You
never
have
to
call
migrate
because
once
you
publish
your
schema
should
be
up
to
date.
That's
not
always
true.
I
mean
I
can
imagine
a
xamarin
app
where,
whenever
it
downloads
a
new
version,
you
need
to
migrate
whatever
version
they
were
on
before
it
could
have
been
two
versions
ago.
It
could
have
been
the
last
version,
and
so
that
is
a
case
where
you
would
want
to
deploy
them,
but
in
this
case
they
just
live
separately.
A
C
That
depends
you
can't
for
the
so
another
thing.
If
I
go
back
to
the
program,
this
is
the
exact
same
db
context
using
all
the
same
domain
classes
and
everything
even
the
on
on
model.
Creating
is
the
same
here,
and
so
you
can't
have
two
sets
of
migrations,
pointing
to
the
same
db
context
in
the
same
assembly.
I
could,
however,
have
one
set
here
in
the
main
application
and
then
another
set
outside
in
a
different
project.
B
So
so
bryce
so
you're
showing
so
that
it
seems,
like
there's
multiple
reasons
here
for
doing
the
two
different
sets
of
migrations
right.
So
we
have
so
we
have
in
in
this
case.
We
want
to
do
sqlite
and
sql
server.
So
can
you
talk
a
little
bit
about
why
we
can't
have
one
migration
set
just
for
every
you
know,
sqlite
sql
server,
all
combined
and
why
it
makes
sense
to
separate
them
out
by
provider.
C
Yeah,
so
let
me
actually
start
digging,
I
don't
know,
maybe
so
the
model
is
actually
different
between
these
two
things
so
see
on
sql
server,
for
example,
your
your
primary
key
columns
typically
have
identity,
yeah
and
there's
not
really
the
same
thing
in
sql
light.
There's
this
auto
increment
idea,
but
it
really
doesn't
match
to
to
sql
server's
version
of
identity
and
so
a
lot
of
the
facets
and
the
data
types
right.
C
Sqlite
has
text,
sql
server
uses
nvar
chart
you
know,
and
so
on
the
surface,
the
models
look
the
same
and
at
the
programming
model
it's
all
kind
of
the
same.
But
by
the
time
you
get
down
to
the
details
of
the
database,
it
gets
pretty
different,
and
so,
if
you
were
diffing
your
sql
light
model
against
your
sql
server
model,
you
know
you
would
actually
get
differences
and
it
could
really
start
to
confuse
migrations,
and
so
we
really
discourage
you
from
trying
to
create
a
single
set
of
migrations
for
multiple
providers.
C
C
C
C
Here's
the
post.
It
points
to
a
blog,
the
blog
that
it
belongs
to
has
a
title
as
a
content
and
the
person
who
authored
that
post
and
then
I
have
a
subtype
of
post
here.
This
is
for
like
a
podcast
or
or
like
a
vlog
or
something
you
know
they
have
a
media
attached
to
each
post,
a
video
or
audio
sample
or
whatever,
and
then
the
uri
to
that
thing,
and
then
mydb
context
is
pretty
straightforward.
I
just
have
db
sets
for
these
things.
C
I
reference
my
derived
types,
so
they
get
included
in
the
model
and
then
I
have
just
for
fun
here.
Actually
I'll
show
you
why
I
have
this
in
a
minute.
I
have
an
index
over
email
for
the
people
to
make
sure
they're
unique
just
so
we
don't
add
the
same
person
twice.
B
B
It
is
a
good
idea,
believe
me
with
the
asp.net
identity
there
used
to
be
an
option
to
well.
There
still
is
an
option
to
not
have
independent
emails
and
people
migrating
from
that
to
oh,
we
want
you
to
have
a
unique
email.
It's
a
major
pain,
so
yeah
go
go
with
unique
from
the
beginning.
That's
what
I
say.
C
Speaking
of
identity,
there
is
a
new
feature
in
5.0
that
lets.
You
exclude
an
entity
type
from
a
db
context,
and
this
is
called
oh.
What
are
they
called
my
mind?
Just
went
blank
foundation.
C
C
I
don't
know
it
has
your
your
paying
customers
and
their
billing
details
or
whatever,
and
so
the
idea
is
you
kind
of
draw
boundaries
around
the
different
parts
of
the
app?
So
one
part
of
the
app
is
all
about
blogging
and
it
just
has
to
worry
about
blogs
it's
in
charge
of
defining
what
a
blog
is
and
how
to
insert
and
update
a
blog
and
then
maybe
another
db
context
is
all
about
identity
and
you
need
to
keep
track
of
users
and
their
passwords
and
their
profile,
settings
and
stuff
like
that.
C
The
problem
with
that
is
there's
often
overlap,
for
example,
a
user
posts,
a
blog,
a
blog
post,
and
so
there's
kind
of
these.
These
foreign
keys
going
between
these
two
things,
but
the
blogging
context
shouldn't
really
define
what
a
user
is.
It
just
happens
to
be
referencing
one,
so
it
can
do
auditing
or
you
know,
show
their
their
avatar
with
their
username
in
the
you
know.
C
C
Table
and
then
for
that
table
we
want
to
exclude
it
from
migrations,
and
so
now,
whenever
you
add
migrations
to
this
context,
it
would
completely
ignore
the
person
entity.
All
the
foreign
keys
would
still
be
there.
Of
course,
then
you
could
add
and
remove
foreign
keys
to
the
users,
but
it
really
kind
of
separates
that
boundary
between
this
is
the
law
drinking
context,
responsibility,
and
this
is
the
identity
context,
responsibility.
B
Yeah,
that's
awesome.
We
have
questions
slightly
related,
which
is
when
about
the
ordering
of
inherited
base
classes.
The
properties
inherited
base
class,
the
base
class
properties
are
created
first
and
then
derived
class
properties
are
afterwards.
Can
I
order
the
base
class
properties.
C
Sure
the
easiest
way
to
order
them
is
to
go
into
the
migration.
So
here's
the
initial,
create
oh
I'll,
actually
do
the
the
sql
server
one.
C
Right
here-
and
we
have-
where
is
that
that's
the
post
table,
so
if
I
wanted
media
url
up
to
be
up
above
just
move
it
move
these
around
like
this
is
the
order
that
the
table
will
be
created
in
you
can
do
it
in
whatever
order
you
want,
and
that's
after
you
add
a
migration
in
the
create
table
statement.
That's
the
simplest
way
to
order
tables.
B
So
the
the
important
thing
to
remember
about
the
column
orders
in
tables.
Is
they
don't
change?
If
you
then
add
another
migration,
you
can't
we
don't
automatically
move
columns
around
and
that's
because
it
requires
a
table
rebuild
to
change
the
column
orders.
B
So
we
get
a
lot
of
questions
about
column
orders,
but
the
reality
is
you're
kind
of
stuck
with
column
orders
effectively
once
you've
created
your
table
so
having
ef
order
them
hasn't,
doesn't
have
that
much
value
over
doing
what
bryce
just
did
and
when
I'm
creating
the
table
to
go
in
and
what
I'll
do
a
one-time?
You
know
order
of
the
of
the
columns
then.
C
And
we
we
try
to
be
helpful
in
the
order.
You
know
we
group
things
together
by
entity
type.
We
put
the
primary
keys
first,
you
know
we
try
and
do
have
a
good
default,
but
everyone's
going
to
want
something
different.
Exactly.
C
B
C
All
righty,
so,
let's
start
making
changes
to
our
model.
Here
I
am
you
know
I
read
up
on
gdpr
and
apparently
I
should
not
be
storing
people's
email
addresses
at
all.
I'm
just
kidding
I'm
grasping
at
straws
for
these
examples,
so
I'm
going
to
remove
the
email
address
from
person.
I
also
had
that
unique
index.
I'm
going
to
go
ahead
and
remove
that
here.
C
C
C
C
So
pretty
simple.
Let's,
let's
go
and
look
at.
Oh!
No!
Let's
so
now
that
I've
done
that,
I
want
to
show
you
something
new
here.
So
we've
always
had
this
dotnet
and
forgive
me
for
using.net
ef
here
in
the
package
venture
console,
but
it's
just
easy:
dotnet
ef
migrations
list.
We've
had
this
for
a
while,
oh
and
I
need
to
specify
which
project
I'm
using
sql
server
migrations
and
which
startup
project
I'm
using
worker
service.
C
C
There
we
go
that
worked.
I
have
no
idea
what
I
did
wrong.
That
is
weird,
probably
type
something
down
so
anyway.
Here
are
my
two
migrations
and
now
it
says
which
one
is
applied
and
which
one
is
not
applied.
E
E
B
A
C
C
And
actually
know
how
to
create
a
procedure.
I
know
sql
server,
I
know
sql
server
has
some
restrictions
and
it
has
to
be
the
first
statement
in
a
batch,
and
I
actually
think
that's
okay
here,
but
if
it's
not,
you
can
only
just
move
it
to
the
beginning,
but
yeah.
So
we
still
do
not
have
any
support
for
creating
stored
procedures
and
we
used
to
do
that
in
ef6
for
cut
operations,
you
could
map
an
entity
to
stored
procedures
and
we
would
actually
scaffold
the
stored
procedures.
C
Is
that
everyone
feels
liberated
to
change
these
things,
we
call
them
scaffold
and
migrations
for
a
reason.
This
is
like
mvc
scaffolding.
You
wouldn't
keep
the
default
edit
page
like
you
want
tweaks
to
it,
you
want
to
add
more
validation.
You
want
to
make
it
pretty
right.
This
is
sort
of
the
bare
bones.
C
D
C
When
really
what
you
wanted
it
to
do
was
rename
a
column
and
vice
versa,
it
may
be
renaming
a
column
and
you
actually
wanted
to
just
start
a
whole
new
column.
So
I
hope
that
you
would
review
these
things.
If
not,
I
guess
you'll
still
be
able
to
store
data,
but
it
may
get
lost
on
the
way.
E
I
think
this
is
this
is
a
question
that
doesn't
stop
coming
actually,
so
a
lot
of
people
have,
this
kind
of
you
know,
respect
like
wrongly
placed
respect
to
these
files,
in
the
sense
that
you
have
generated
this
for
me
and
I'm
not
supposed
to
touch
generated
code
right.
There's
this
this
kind
of
thing
and
we
keep
telling
people.
No,
it's
actually
fine,
this
stuff,
we
did
for
you,
but
now
it's
yours.
This
is
your
code.
Now
it's
part
of
your
project.
C
A
Which
is
good
because
I
think
there
is
an
impression
that
it
should
be
just
this
wholly
automated
process,
and
you
know
you
tweak
some
classes
and
and
run
it
so
there
there
is
a
place
in
the
development
life
cycle
to
monitor,
manage
these.
Just
like
you
would,
if
you
weren't
using
any
framework
core,
if
you're
you
don't
just
haphazardly,
make
schema
changes
to
a
database.
So
it's
good
to
call
that
out.
B
Yeah
and
but
we
designed
it
this
way
specifically
because
we
knew
that,
however
good
migrations
got,
there
would
always
be
cases
where
you
needed
to
do
things
that
we
couldn't
figure
out
automatically
or
we
just
couldn't
handle
automatically
like.
So
we
talked
about
table
rebuilds.
I
think
here
I
think
bryce
is
going
to
show
table
robots
on
sql
lite,
hopefully
later,
but
on
sql
server.
B
C
Yeah
and
hopefully
we'll
get
to
the
demo,
where
I
do
that
later
here
so
also
since
this
is
powershell,
this
get
migration
thing
is
actually
scriptable,
so
here's
just
a
fun
little
query
like
get
me
all
the
migrations
that
have
been
applied
and
select
the
last
one
and
give
me
its
id,
and
so
now
you
can
easily
get
what
was
the
last
migration
applied
to
this
database
initial
create.
C
Generated
there's
gonna
be
a
few
new
things
you
may
notice
here.
This
begin
transaction
statement
is
something
that
we
haven't
done
in
the
past.
Oh
oops
actually
wanted
to
do
this.
Sorry
I'll
look
at.
C
C
So
our
hope
is
that
by
adding
these
transaction
begin
and
transaction
commit
sort
of
around
each
migration
that
whenever
something
fails,
your
database
should
at
least
be
up
between
one
of
the
migrations,
and
you
won't
be
in
this
bad
state
that
you
have
to
recover
from
those
are
new.
If
you
don't
want
them,
there's
a
flag
to
remove
them,
but
I
hope
everyone
wants
them
and
I
hope
they
work
everywhere.
If
they
don't.
Let
us
know.
B
So
we
didn't
do
this
before,
because
we
were
for
two
reasons:
really.
We
were
a
bit
we're
a
bit
unsure
that
they
would
work
everywhere,
but
we've
done
more
more
investigation
and
we
think
they
will
now
and
also
because
we
wanted
to
leave
it
so
that
you
could
do
your
own
transactions
in
the
way
you
wanted,
when
you
were
applying
these
scripts.
B
C
And
I've
seen
some
really
cool
solutions
where
people
generate
each
migration
in
its
own
sql
script
and
then
write
like
a
bash
shell
around
them
to
kind
of
see
which
ones
are
applied
and
then
invoke
them
individually.
So
it's
a
pretty
flexible
system
here
so.
B
There's
a
comment
here
that
I
think
is
quite
is
quite
useful,
saying
that
maybe
we
should
put
a
comment
in
that
says
this
is
scaffolded
and
you're
supposed
to
editing
it.
We
always
we're
always
closing
the
issue
of
saying
it's
auto-generated.
Maybe
we
should
put
something
in
the
actual
scaffolding
migration
saying
that
I
think
I
think
that's
actually
a
pretty
good
idea.
Yeah.
C
That's
good
advice,
so
here
on
sql
server,
you
can
see
it's
just
a
simple
drop
column
statement.
Just
ignore
all
this.
C
No,
this
is
to
drop
any
default
constraints,
which
we
don't
always
know
if
they're
there
or
not.
But
ideally
this
could
just
be
a
simple
drop
column
on
sql
server.
One
more
thing
I
wanted
to
look
at
in
the
script
is
this
item
potent
and
an
item.
Potent
script
is
a
script
that
you
should
be
able
to
run
on
any
database
that
has
had
these
migrations
and
no
matter
where
they're
at
it
will
bring
them
up
to
date.
C
C
The
parser
gets
really
confused
and
it
will
throw
an
error
even
though
this
code
would
never
run,
and
so
we
had
a
few
people
report
that
bug
and
what
we've
done
in
ef
core
5
is
enable
providers
to
know
whether
it's
generating
an
item,
potent
script
or
even
a
script
at
all.
So
it
can.
It
can
do
these
sort
of
work
arounds
to
make
the
script
more
robust,
and
I
know
there
were
a
few
fixes
that
went
into
postgres.
For
this
too
shy.
Do
you
want
to
talk
to
those.
E
Yeah
this
there's
two
issues
that
have
been
long
standing
on
in
postgres
and
the
problem
is
once
again
just
like
you
said
when
you're
doing
an
item
potent
script
and
when
you're
doing
a
normal
script,
things
have
to
look
a
little
bit
different.
E
So
like
one
one
very
painful
kind
of
point:
when
people
do
data
seating
in
general,
so
that's
a
way
of
loading
data
into
your
database,
obviously
you're
sitting
and
you're,
seeing
id
values
as
well
right,
so
you're
sitting
blog
with
id1
blog
with
id2,
but
there's
also
a
so-called
identity,
like
a
sequence,
backed
kind
of
id
right
for
that
id.
And
it's
not
aware
of
the
fact
that
you,
you
use
seating
in
order
to
insert
these
two
blocks.
E
So
it's
still
stuck
at
one,
although
you've
already
inserted
two
that's
kind
of
a
thing
where
postgres
is
maybe
a
little
bit
backwards
compared
to
other
databases
which
will
automatically
update
their
there's
a
good
reason
for
this,
but
other
databases
will
sometimes
just
you
know
they
know.
Okay,
you
just
inserted
it.
So
I'm
gonna
update
that
sequence
or
identity
or
whatever.
So
this
doesn't
happen
with
postgres
and
it
causes
a
lot
of
pain
to
people
right,
because
you
see
your
your
blogs
and
then
the
next
time
you
try
to
insert
something
boom,
it
explodes.
E
So
what
are
you
what
we
used
to
tell
people
which
is
not
necessarily
a
bad
idea?
It's
like
a
trick.
Just
use
negative
ids
right,
just
see
data
with
minus
one
minus
two.
This
way
you
never
have
this
conflict,
but
you
know
sometimes
that's
not
completely
appropriate
and
people
don't
necessarily
wanna
have
negative
ids
and
so
on.
So
what
I
did
was
something
for
5.0
like
one
of
the
new
features
in
rc1.
E
Is
that
there's
like
this
kind
of
fancy
thing
where,
when
you
do
seating,
that's
detected
and
I'm
gonna
do
this
kind
of
magical
snippet
of
sql?
That's
gonna
update
the
backing
sequence
of
your
ids
to
the
maximum
of
the
column
and
there's
a
bit
more
complexity
there,
and
this
kind
of
complex
code
looks
different.
If
you
do
it
in
an
item,
potent
thing
which
is,
you
know,
a
whole
different
kind
of
environment
or
just
in
a
normal
script.
E
C
I
think
firebird
had
a
use
case
for
it
too
something
around
our
procedures.
So
it's
really
cool
to
see
that
our
fix
for
sql
server
enabled
other
providers
to
fix
similar
bugs
with
the.
E
C
Yeah,
all
right
so
moving
on,
we've
got
our
migration
and
we
want
to
apply
it
to
our
database.
Of
course,
there's
update
database
for
that.
Well,
I
guess
not,
of
course,
if
you're
new
to
migrations
wow,
I
can't
type
I'm
going
to
use
auto
completion
here,
all
right,
update
database
and
let's
say
I'm
ready
to
go
to
deploy
this
to
production.
You
know
a
few
things
people
have
done
in
the
past
is
like
go
inside
your
app
settings,
change
the
connection
string
and
then
run
it.
C
That's
not
ideal.
They
may
have
a
production
connection
string
here
in
production
and
we
can
and
and
used
to
be
able
to
set-
or
I
guess
you
still
can
set
sort
of
the
asp.net
or
the
generic
host
environment.
Variable
that's
used
to
configure
the
environment,
so
it
uses
this
production
connection
string
instead.
C
But
if
we
go
back
and
look
at
program
here,
we'll
see
there's
this
args
that's
being
passed
in
and
when
you
run
the
application
it's
passed
in
from
the
command
line.
One
of
the
things
we've
done
in
ef
core
five
is
to
allow
you
to
pass
things
into
this
arguments
thing
and
if
you've
ever
used
the
I
design
time,
dbcontextfactory,
there's
also
an
args
parameter
there.
That
was
completely
unused.
C
We
always
had
this
in
mind,
so
we
finally
implemented
this
update
database
dash,
args
you'll,
see
these
args
are
passed
into
the
default
host
builder
and
one
of
the
things
that
lets
you
do
is
actually
specify
the
environment,
environment
production,
and
so
this
is
a
cool
way,
but
the
tools
can
now
flow
things
into
your
host
builder
and
change,
for
example,
which
configuration
it
uses.
This
looks
cool,
but
in
reality
I
really
don't
think
you
should
have
a
production
connection
string
that
lets
you
alter
the
schema.
C
That's
a
big
red
flag
to
me,
so
an
even
better
alternative,
which
we've
also
added,
is
instead
of
passing
in
args.
We
have
a
dash
connection,
string
or
connection
parameter
here,
and
you
can
actually
just
specify
you
know
your
your
connection
string
here
to
go
directly
to
production,
so
you'd,
like
vpn
behind
the
firewall,
where
you
have
direct
line
of
sight
to
your
production
database.
C
You
know
you
take
down
your
website
put
up
the
under
construction.
You
know
what
whatever
your
deployment
process
is
like,
and
then
you
can
point
this
directly
at
your
production
database.
Use
all
your
credentials
that
have
power
to
drop
columns
and
alter
the
schema,
and
you
don't
have
to
change
the
app
you
don't
have
to
like
manually.
Add
this
password
somewhere
or
set
an
environment
variable.
You
can
do
it
all
from
the
command
line
here
and
let's
see
what
else
did
I
want
to
say?
C
Oh
yeah,
I'm
sorry
backing
up
the
args
thing
we'll
actually
get
to
that
in
a
minute.
So
let's
apply
we've
added
a
migration
for
sql
server
here,
but
we
have
two
sets
of
migrations
and
the
sqlite
migration
still
hasn't
captured
that
we've
removed
this
index
post.
C
C
But
as
we
just
learned
like,
we
can
now
float
things
in
to
the
design
time,
and
so
this
args
is
passed
into
the
host
builder,
which
uses
the
args
as
part
of
its
configuration.
So
we
can
actually
specify
this
provider
now
on
the
command
line.
So
add:
migration,
whatever
I
call
it
remove
person
index,
doesn't
have
to
be.
The
same
name
probably
makes
sense
if
it
is
and
then
using
this
args
thing
dash
dash
provider
light,
and
so
this
is
going
to
come
in
the
design
time
is
going
to
create
my
house.
C
E
C
C
So
on
the
command
line,
because
it's
kind
of
all
the
same
idiomatic
dash
dash
and
short
options,
and
all
that
we
actually
let
you
pass
them
without
in
a
string.
So
if
you
notice
on
powershell,
I
had
to
put
that
thing
in
a
string.
If
I
can
go
back
to
it,
I
had
to
put
all
the
arguments
kind
of
in
this
string
that
got
tacked
on
to
the
end
of
when
it
or
yeah
they
got
passed
into
your
application.
C
What
this
dash
dash
thing
is,
is
it's
a
special
marker
to
say
everything
after
this
is
another
argument,
and
so
there's
options,
which
are
these
things
that
have
hyphens
and
then
there's
arguments
which
is
like
the
migration
name
was
an
argument
and
any
argument
that
the.net
ef
command
doesn't
use.
For
example,
the
only
argument
you
can
specify
for
add
migration
is
the
migration
name,
and
then
everything
after
that
is
just
kind
of
left
over
and
it
doesn't
know
what
to
do
with
them,
and
so
it
passes
them
to
the
application.
C
So
that's
all
this
hyphen
is,
it
just
says:
don't
treat
this
thing
like
a
flag
that
net
ef
is
supposed
to
parse,
pass
it
to
my
application.
If
that
makes
sense,.
B
So
a
word
on
package
manager
versus
the
dot
net
ef
commands.
So
one
thing
to
note
is
that
the
the
dot
net
ef
commands
are
perfectly
usable
in
visual
studio
as
bryce
is
showing,
and
the
package
manager
commands.
B
Obviously,
as
we're
seeing
work
with
ef
core
we've
had
some
people
think
they
only
work
with
the
f6,
it's
a
different
set
of
commands,
but
they
do
and
we
try
and
be
idiomatic
to
powershell
or
a
command
line
parser
in
both
cases,
which
is
why
the
the
syntax
is
is
different
for
those
two
things,
so
it
works
well.
In
both
cases,
we
would
like
to
get
gather
feedback.
B
So
if
you
have
any
feedback
post
on
github
or
contact
us
in
some
other
way
on
whether
you
use
the
package
manager
console
or
you
prefer
the
the
command
line
that
that's
something
that
we're
interested
in
in
finding
out
about.
A
C
The
power
tools,
ef
power
tools,
I
believe,
have
a
little
tool
window
that
you
can
add
and
it
says:
hey
you
have
pending
migrations.
Would
you
like
to
add
a
migration?
So
it's
a
very
interactive
experience.
It's
pretty
cool!
There
are
tools
for
that.
I've
thought
about
it
in
the
past,
but
we
haven't
really
done
any
visual
studio
extensibility
on
the
team,
thus
far,
we've
kind
of
let
eric
handle
that
and
he's
handled
it
great
in
my
opinion,
so.
A
C
The
easiest
way
is
to
implement
that
I
design
time
interface
and
it's
literally
just
called
that,
like
class
x,
I
design
time.
C
C
If
this
entry
point
is
ever
called
the
only
thing
that
we'll
call
this
thing
is
the
tools,
and
so
you
can
you
can
do
whatever
you
want
here
to
kind
of
new
up
your
db
context,
with
the
knowledge
that
it's
being
done
at
design
time
for
things
related.
B
But
I
think,
but
I
think
the
question
here
is
more:
if
I'm
understanding
it
rightly,
if
I'm
like
writing
a
provider
like
lawrence,
that's
the
question
is,
and
I
want
to
know
actually
this
code
is
running
in
the
context
of
an
application.
That's
doing
a
design
time
thing.
Is
there
an
easy
way
to
do
that
without
looking
at
the
stack
frame,
which
I.
C
A
C
C
All
right,
so,
let's
go
back
to
the
migration
wherever
it
was.
I
think
I
just
closed
it
whoops.
C
So
if
you
look
at
the
sql
server
and
the
sql
lite
migration,
I
mean
you
can
barely
tell
I'm
switching
tabs
here.
They
look
identical
because
they're
trying
to
perform
the
same
operations.
The
data
types
are
different.
There's
varchar
down
here
in
sql
server
text
here
this
is
nice,
because
this
is
really
like
a
dsl,
a
domain,
specific
language.
It
you're
able
to
declare
like
what
you
want
to
happen
to
the
database.
If
you
know
anything
about
sql,
lite
you'll
know
it
can
actually
support
a
drop
column
operation.
C
C
C
All
right,
so
we
go,
we
dropped
the
index.
Okay,
that's
expected
and
then
oh
we're,
creating
a
table
here.
We're
creating
a
temporary
table
and
this
table
is
in
the
exact
same
shape
as
our
original
people
table,
except
it
has
the
email
column
missing,
and
so
this
is
called
a
table
rebuild.
We
create
a
new
table
with
the
schema
that
we
want
to
happen
with
all
the
constraints
in
place
and
everything
like
if
we
were
adding
any
unique
constraint.
C
This
new
table
would
have
that
unique
constraint
and
then
we
copy
all
the
data
from
the
original
table
into
this
people
table.
We
don't
copy
the
email
address
because
there's
nowhere
for
it
to
go,
and
then
we
hit
a
point
of
no
return.
C
We
have
to
commit
the
transaction
which
is
really
unfortunate.
The
the
one,
the
few
things,
the
rob
the
problem
with
that
sorry
getting
tripped
over
the
problem
with
that
is
that
if.
C
After
this
point,
your
database
is
going
to
be
halfway
through
a
migration,
and
so
it's
not
a
good
place
to
be
in
some
of
the
things
we've
tried
to
mitigate
that
problem
is
again.
We
create
all
the
constraints
here.
So
if
you're
adding
any
constraint,
but
your
column
violates
that
unique
constraint,
it's
going
to
throw
before
we
hit
this
point
of
no
return,
and
the
other
thing
we
do
is
we
try
and
apply
everything
we
can
before
we
try
and
rebuild
any
tables.
C
So
all
the
table
rebuilds
will
happen
at
the
very
end
of
a
migration.
So
hopefully,
if
anything
is
going
to
go
wrong
with
the
migration,
it's
already
happened
by
this
point.
The
next
thing
we
do
here
is
this.
We
turn
foreign
keys
off.
I
like
to
think
of
this
as
like
a
three-year-old
magic
trick
right
like
okay.
Now
everyone
close
your
eyes.
You
know.
C
And
then
we
quickly
drop
the
table
and
then
swap
out
this
new
table
for
the
old
table
and
the
reason
the
foreign
keys
have
to
look
away.
Is
a
lot
of
them?
Would
freak
out
over
this
statement
right
here
like.
C
C
You
know,
but
because
we
tell
them
like
just
ignore,
what's
going
on
here
and
then
we
swap
it
out
by
the
time
they
open
their
eyes
again.
There's
a
new
person
table
that
magically
the
the
email
column
is
gone,
but
all
the
ids
are
still
there.
All
the
foreign
keys
are
still
there.
So
all
the
integrity
is
preserved.
They
have
no
idea
what
hit
them,
but
we
were
able
to
drop
this
column
and
then
nice
we
begin
the
transaction.
There
is
another
step
that
could
happen
after
here
is
we?
C
C
Not
that
one
ef
docs
then
sql
lite
limitations,
I'm
just
gonna
search
for
5.0,
so
you
can
kind
of
get
a
visual.
These
are
all
the
operations
and
when
they
were
supported
so
in
5.0
like
there
are
a
ton
of
new
operations
that
you
can
suddenly
do
in
migrations
and
finally,
sqlite
feels
just
like
another
database.
Here
you
can
add
check
constraints,
you
can
add
primary
keys,
you
need
constraints,
you
can
drop
constraints,
you
can
alter
columns.
C
Finally,
and
so
really
for
the
first
time,
sqlite
in
ef
core
is
really
robust
with
migrations,
and
we
hope
people
get
a
lot
of
value
out
of
this
yeah.
E
I
have
to
say
something
about
this,
so
I
I
also
think
it's
it's
really
super
awesome,
but
there's
one
thing:
just
just
that's
important
for
people
to
understand
this
is
obviously
not
an
easy
operation
right
like
to
to
create
a
table
move
the
data
drop,
alter
the
name
and
all
that
one
very
important
point
that
people
should
understand
is:
if
you
ever
do
something
like
this
on
a
serious
production,
so
we're
in
sql
light,
I'm
guessing
that
it's
going
to
be
a
bit
rare
for
people
to
run
like
a
super
big
live
database
and
it's
not
really
possible
to
do
it
concurrently,
but
in
general,
I'm
using
this
as
a
point.
E
E
This
could
go
really
quite
bad,
and
the
point
that
I'm
trying
to
make
here
is
that
migrations,
although
you
can
kind
of
oh
sure,
I'm
gonna,
you
know
alter
my
schema
when
my
application
next
kind
of
is
deployed
and
goes
live,
and
we
have
several
servers
and
each
one
of
them
is
maybe
going
up
and
doing
all
these
schema
changes
be
very
careful
about
how
you
apply
your
migrations.
E
C
It
and
there's
a
reason
we
did
this
first
on
sqlite,
you
know,
usually
it's
like
one
application
has
one
database
and
that
database
isn't
shared.
We
hope,
and
so
a
lot
of
the
risks
are
sort
of
mitigated
by
the
fact
that
it
is
sqlite
running
hopefully
like
on
a
small
device
or
in
isolation.
C
And
again
I
talked
about
the
mitigations
about
we
try
and
do
everything
first.
So
we
don't
like
end
up
in
a
bad
state.
Here
it
is
risky,
but
hopefully
for
sql
light
scenarios.
The
the
value
far
outweighs
any
any
of
the
risks
here.
Yeah.
C
B
Back
to
what
I
was
talking
about
earlier,
I
think
it's
very
unlikely
that
we'll
do
table
builds
on
sql
server,
because
the
number
of
different
ways
that
you
can
configure
both
the
table,
the
columns,
the
relationships,
the
constraints,
everything
on
sql
server-
is
so
big
that
dropping
it
and
creating
those
all
correctly
again
on
the
new
table
is,
is,
I
think,
going
to
be
very
error
prone,
even
if
we
have
enough
metadata
sqlite,
while
the
simplicity
of
it
caused
us
to
need
to
do.
B
This
more
also
allows
us
to
do
this,
because
it
has
a
pretty
simple
model
with
pretty
simple
types
and
constraints
and
facets
and
things
so
so
I
think
this
is
a
it's
an
example
where
we
can
do
on
sql
lite,
where
it's
more
needed,
but
we
probably
won't
bring
it
to
other
other
providers.
C
One
more
limitation
worth
calling
out
here
is
that
this
table
has
to
be
part
of
your
ef
model.
If
this
table
is
just
some
out
of
band
table
that
you're
trying
to
alter
it's,
you
know
we
can't.
We
can't
rebuild
it
because
we
don't
know
what
it
looks
like,
and
so
we
won't
even
try.
C
C
Actually,
I
have
two,
but
we'll
start
with
the
big
one
and
see
if
we
have
time
for
the
other
one.
Okay,
so
nef
core
five
one
of
the
things
we
added
was
a
tpt
mapping
and
just
to
give
a
bit
of
background
here,
I
want
to
run.
I
don't
know
if
you
guys
are
actually
familiar.
C
C
C
So
this
is
kind
of
risky,
but
it's
a
really
cool
tool
to
sort
of
look
at
the
database
that
your
model
is
expecting
and
you
could
take
the
script
and
run
it
with
against
schema,
compare
and
in
sql
server
data
tools-
and
you
know
for
those
I'm
not
using
migrations,
just
a
handy
little
thing
to
have
so.
B
This
is
essentially
the
equivalent
of
ensure
created
at
runtime.
C
Yeah
yeah
dbcontext.database.intercreated.
So
if
we
look
at
this
post
table,
we
have
this
discriminator,
we
don't
promote
discrimination.
This
is
this
is
basically
the
type
there's
two
types
of
posts.
This
discriminator
will
say:
oh
it's,
either
post
or
it's
one
of
those
media
posts
we
talk
about
and
if
it's
a
media
post
it
might
have
these
two
additional
columns,
the
url
and
the
media
type.
So
everything
gets
shoved
into
one
table.
B
B
B
C
So
so
here
the
idea
is:
whenever
you
do
an
insert
or
a
query,
you
only
have
to
look
at
one
table.
It's
you
know
you
don't
have
to
do
a
billion
joins
or
anything
one
of
the
downsides
of
tph.
C
Some
people
call
it
single
table
inheritance
if
you're
more
familiar
with
that
pattern
is
a
lot
of
these
columns
are
null
because
if
it's
not
a
medium
post,
all
these
columns
are
going
to
be
null
and
if
you
have
a
a
high
hierarchy,
you're
going
to
have
lots
and
longs
in
your
table
and
some
people
don't
like
that
and
so
tbt.
C
On
the
other
hand,
if
we
let's
say
you
go
back
to
our
model,
the
way
we
get
tbt
is
we
say:
hey
this
media
post
entity.
I
actually
want
to
put
it
in
its
own
table
media
posts
and
then
I'm
going
to
run
this
script
db
context
again
just
to
see
if
I
did
it
right.
You
know
it's
hard,
it's
hard
using
metadata.
C
So
here
I
have
the
post
table
and
I
have
the
oh
there.
It
is
the
media
post
table.
These
two
columns
are
here
and
there's
a
foreign
key
over
the
id
pointing
back
to
post
this
foreign
key
is
like
an
inheritance.
D
C
If
a
post
doesn't
have
a
corresponding
media
post,
then
it's
just
a
post,
and
so
here
you
can
see
if
I
have
a
page
that
only
displays
sort
of
the
media
urls
and
their
types
like
all
it
has
to
do,
is
query
one
table,
and
so
it
really
depends
on
your
how
you
query
the
data
as
to
which
mapping
you
want
to
use.
D
E
In
fact,
in
many
cases,
we've
known
it
to
be
like
not
necessarily
optimal
for
performance,
but
I
don't
think
we're
going
to
get
into
this
now.
C
B
C
All
right,
uh-oh
data
loss.
I
do
not
want
to
lose
any
data
here,
I'm
not
expecting
that
that
should
not
be
there.
That's
a
big
red
flag
here.
Let's
see
it
goes
through.
Oh
it
drops
these
columns.
Well
wait
a
minute.
I
don't
want
to
drop
those.
Yet
I
need
to
move
that
data
somewhere,
and
so
I
need
some
place
to
put
that
data
before
we
drop
it.
So
I'm
going
to
move
these
okay
there's
the
columns.
C
C
Around
and
again
you
don't
have
to
think
that
this
think
about
whether
this
is
going
to
be
a
table
rebuild
or
not.
Here
you
just
say
I
want
that
to
happen
after
this,
so
we're
going
to
create
the
table
here
and
before
we
drop
these
columns,
we
want
to
move
the
data.
C
Migrationbuilder.Sql,
plural
string
and
we're
going
to
do
we're
going
to
break
out
our
t
sql
skills
here.
This
is
actually
standard.
Sql
we're
going
to
update
no
we're
going
to
insert
insert
into
new
table
that
we
just
created,
and
these
new
columns
are
listed
right
here.
C
We're
going
to
insert
into
there
and
we're
going
to
insert
by
selecting
these
same
columns
actually
because
they
didn't
actually
change
names.
C
So
we
create
this
new
table
to
put
these
things
in
and
then
we
copy
the
data
out
of
the
old
table,
all
the
media
posts.
You
can
imagine
if
you
had
multiple
types
here,
you'd
need
to
insert
into
multiple
tables
and
then
finally
we
drop
the
tables
here.
B
Yeah,
so
so
what
you're
doing
here
is
you
you're?
Actually
writing,
sql
and
putting
it
inside
your
migration
scripts
to
move
the
data
from
one
table
to
the
other?
So
I
think
we
call
that
data
motion
right,
yeah
yeah,
so
there
is
an
issue
on
the
backlog
that
you
can
vote
for
for
writing
a
more
declarative
api
for
this.
It's
it's
not
clear.
B
The
value
of
that
versus
just
writing.
Sql.
The
question
we
always
get
asked
is:
why
can't
I
just
use
my
c
sharp
code
to
do
this.
Well,
because,
typically,
your
c
sharp
code
only
represents
your
final
model,
not
the
previous
models
and
so
writing
against
two
models
in
c
sharp.
We
did
try
and
do
that
at
one
point
it
was
really
it
was
it
was.
It
was
a
hot
mess.
B
It
wasn't
anything
we
shipped
so
basically,
you've
got
to
have
to
do
this
at
the
database
level
with
sql
and
we
may
be
able
to
make
that
a
little
bit
easier
with
some
apis,
but
essentially
it's
not
something
that
we
think
we
can
kind
of
abstract
out
easily
to
just
doing
it.
The
c-sharp
layer,
unfortunately,.
C
B
Did
you
did
you,
did
you
run
the
did,
you
run
the
migrations
and
it
worked
and
everything?
Okay.
C
Let
me
just
wipe
out
the
database
entirely
and
go
back
to
the
like
themes
right
here.
Let's
do
add
migration
update
database
we'll
do
bash
verbose
for
you.
B
E
B
C
E
C
A
Just
kidding
so
that
sounds
good,
so
that's
a
good
place
to
rap.
I
think,
and
hopefully
everyone
is
going
out
downloading
the
release
candidate
bits,
taking
a
look
at
a
lot
of
new
features
and
functionality.
I
think
I'm
always
surprised.
I've
been
tracking
this
for
months
now
and
I
still
see
new
features
demoed
and
just
go
so
look
forward
to
you
trying
that
out,
look
forward
to
your
feedback
and
appreciate
everyone
joining
us
today
and
we
will
be
back
here
in
two
weeks.