# What is the canonical divisor on an arithemetic curve?

Let an arithemetic curve be an integral scheme $X$ whose structure morphism $\pi:X\rightarrow B=Spec(O_{K})$ is projective, flat and of pure dimension $0$, and whose generic fiber is regular. I am wondering if there is any good definition of the canonical divisor of $X$. I realized the relative dualizing sheaf construction does not work. Classically, we use the inverse of the different for the base. In this case, however the map is only surjective. I am not entirely sure if the pull-back sheaf will be what I wanted.