# Extending a Cartier divisor on a curve to singular points?

Let $k$ be an algebraically closed field with $\text{char } k \neq 2$. Suppose we have a projective plane curve with a singular point. The example I have in mind asking this question is the curve $y^{2}z = x^{3}$ in $\mathbb{P}_{k}^{2}$ of Example II.6.11.4 of Hartshorne. This has one singularity at the point $Z = (0, 0, 1)$. Call this curve $X$.

This scheme is not even normal or regular in codimension $1$, so we can't talk about Weil divisors but we can talk about Cartier divisors. However the open subset $U = X \setminus \{ Z \}$ is locally factorial, so not only can we talk about Weil divisors, but we have a correspondence between Weil divisors and Cartier divisors. Is it possible to begin with a Cartier divisor on $U$, then extend it to all of $X$? The reason I want to do this is so that I can define a surjective degree map, $$\text{deg}: \text{CaCl } X \longrightarrow \mathbb{Z}.$$ In order to do this, I want to be able to justify that every Weil divisor on $U$ can be realised as the restriction of some Cartier divisor on $X$. Since $U$ is locally factorial, this is equivalent to the claim that every Cartier divisor on $U$ can be realised as the restriction of a Cartier divisor on $X$. I'm fairly confident this is possible, but I haven't been able to figure out the details. Is anyone able to walk me through that process? In what generality does that hold?

As an aside, is there some canonical or natural definition of degree for Cartier divisors in general?

Yes, every Cartier divisor on $U$ can be considered as a Cartier divisor on $X$, just because the definition of a Cartier divisor is local. Such an extension, however, is not compatible with linear equivalence, since a rational function on $U$ can have extra zeros/poles on $X$.
For example, in your situation $U \cong \mathbb{A}^1$, so any point $P \in U$ considered as a Cartier divisor on $U$ is principal, but when considered as a Cartier divisor on $X$ it is not principal.